Closed HDembinski closed 1 year ago
I tried to use with pytest.warns
and find out that it assert that code raises a particular class of warning
, i.e. it raise an exception if the warning isn't issued. This is a problem because some models produce warning and other don't.
It seems easier to disable warnings using addopts = "-p no:warnings"
in pyproject.toml. @HDembinski, what do you think about it?
No, we don't want to suppress warnings. The warnings are useful and they are part of our UX design, it is good to assert that they are raised as we expect them to be raised.
I tried to use with pytest.warns and find out that it assert that code raises a particular class of warning, i.e. it raise an exception if the warning isn't issued. This is a problem because some models produce warning and other don't.
Then you check whether the conditions are fulfilled and only use the with statement
in those cases.
Fixed in #127
Several unit tests now emit uncaptured warnings. Tests should not emit those. If a warning is expected in a test, you should use