Skip to content

Commit 0ac0529

Browse files
committed
GSK-2617 Missing kwargs in a test make the whole suite fail (Hub)
1 parent eb70813 commit 0ac0529

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

tests/test_suite.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,25 @@ def test_default_parameters_are_used_at_runtime(german_credit_data, german_credi
2727
# This will miss dataset
2828
suite = Suite(default_params=dict(model=german_credit_model))
2929
suite.add_test(my_test)
30-
with pytest.raises(ValueError):
31-
suite.run()
30+
result = suite.run()
31+
assert not result.passed
32+
_, test_result, _ = result.results[0]
33+
assert test_result.is_error
3234

3335
# But we can pass dataset at runtime
34-
suite.run(dataset=german_credit_data)
36+
result = suite.run(dataset=german_credit_data)
37+
assert result.passed
38+
_, test_result, _ = result.results[0]
39+
assert not test_result.is_error
40+
assert test_result.passed
3541

3642
# Or we can provide it in the suite defaults
3743
suite.default_params["dataset"] = german_credit_data
38-
suite.run()
44+
result = suite.run()
45+
assert result.passed
46+
_, test_result, _ = result.results[0]
47+
assert not test_result.is_error
48+
assert test_result.passed
3949

4050

4151
def test_runtime_parameters_override_default_parameters(german_credit_data, german_credit_model):

0 commit comments

Comments
 (0)