-
Notifications
You must be signed in to change notification settings - Fork 12
Closed
Copy link
Labels
good first issueIndicates a good issue for first-time contributorsIndicates a good issue for first-time contributorsimprovementExisting functionality, but better, faster, strongerExisting functionality, but better, faster, stronger
Description
Describe the problem
Currently, we use warnings
to catch, suppress and raise warnings in testing, e.g., using
with warnings.catch_warnings():
warnings.simplefilter("error")
It would be much cleaner to use pytest
's filterwarning
, either as a decorator
@pytest.mark.filterwarnings("error")
or even at the global level, using
# pyproject.toml
[tool.pytest.ini_options]
filterwarnings = ["error"]
However, unfortunately, enabling that causes new warnings to pop up. That is a consequence of other things we or dependencies are not doing nicely, so they really are real warnings.
Raised in #320 (comment)
Its much cleaner to use @pytest.mark.filterwarnings("error") decorator instead
Improvement proposal
This issue consists of multiple steps:
- Replace all
with warnings.catch_warnings(): warnings.simplefilter("error")
blocks with@pytest.mark.filterwarnings("error")
decorators- Either fix or explicitly suppress all new errors that pop up
- Create pull + merge request
- [after the previous step is resolved] Replace all
@pytest.mark.filterwarnings("error")
decorators with one global setting in thepyproject.toml
(see above)- Either fix or explicitly suppress all new errors that pop up
- Create pull + merge request
Split from #320 (comment)
Metadata
Metadata
Assignees
Labels
good first issueIndicates a good issue for first-time contributorsIndicates a good issue for first-time contributorsimprovementExisting functionality, but better, faster, strongerExisting functionality, but better, faster, stronger
Type
Projects
Status
No status