Skip to content

Commit

Permalink
Make sure to filter warnings to errors
Browse files Browse the repository at this point in the history
One test case after the transition from pytest.warns(None) is attempting
to check it raises no warnings, but as written the context manager
swallows all warnings. Set the filter to error to make certain they are
raised.
  • Loading branch information
s-t-e-v-e-n-k committed Jan 9, 2025
1 parent ac777e0 commit a416c80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions jenkinsapi_tests/unittests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ def fake_get_data(cls, tree=None, params=None):

with pytest.raises(Exception) as excinfo:
with warnings.catch_warnings():
warnings.simplefilter("error")
build.get_env_vars()
assert "" == str(excinfo.value)

Expand Down

0 comments on commit a416c80

Please sign in to comment.