Warnings from conftest.py should show up in warning summary
See original GitHub issueRight now if a conftest.py
(or a module it imports) issues a warning, it does not show up in the warnings summary. Since conftest.py
can be used to load plugins from other packages, it would be useful to be able to issue DeprecationWarning
s and other warnings that are actually visible when pytest
is run.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:9 (6 by maintainers)
Top Results From Across the Web
How to capture warnings — pytest documentation
Although not recommended, you can use the --disable-warnings command-line option to suppress the warning summary entirely from the test run output. Disabling ...
Read more >How to suppress py.test internal deprecation warnings
Disabling all warnings persistently (i.e. using pytest.ini) is almost never a good idea. Disabling just Deprecation warning (and by module) as ...
Read more >How to Fix a PytestCollectionWarning about WebTest's ...
This happens because pytest tries to collect the TestApp class as a test class, but it finds it is incompatible.
Read more >pytest-benchmark - Python Package Health Analysis - Snyk
A ``pytest`` fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. For more information...
Read more >Show Pytest Warnings (2016) — pytest-tricks
Pytest. In the following example, pytest displays pytest-warnings at the very end of the test run in the session summary. $ py.test ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Exactly. The case you describe was my first point, which I don’t believe is doable right now without changing the pytest’s internals.
The second scenario describes when a test module
test_foo.py
emits a warning during import (or other module it imports emits it), then I believe it is possible to implement this in a custom plugin (conftest.py
file).Definitely @drdavella, this is on our plans, please see #2452