Skip to content

Commit

Permalink
[BUG] fix test_run_test_for_class test logic (#6448)
Browse files Browse the repository at this point in the history
The `test_run_test_for_class` test logic was erroneous in case the class
with dependency was changed.

This is due to an accidental variable overwrite, `run_no_dep` being
overwritten with the value from the test class with dependencies.

Spotted through failure in sktime/skpro#343,
which changed the "class with dependencies" example used in `skpro`.
  • Loading branch information
fkiraly committed May 19, 2024
1 parent 76725c5 commit b0621f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sktime/tests/tests/test_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ def test_run_test_for_class():
assert reason_nodep == "False_no_change"

# now check estimator with soft deps
run_nodep = run_test_for_class(f_with_deps)
run_wdep = run_test_for_class(f_with_deps)
assert isinstance(run, bool)

dep_present = _check_estimator_deps(f_with_deps, severity="none")
if not dep_present:
assert not run_nodep
assert not run_wdep

res = run_test_for_class(f_with_deps, return_reason=True)
assert isinstance(res, tuple)
Expand Down

0 comments on commit b0621f3

Please sign in to comment.