question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings from conftest.py should show up in warning summary

See original GitHub issue

Right 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 DeprecationWarnings and other warnings that are actually visible when pytest is run.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nicoddemuscommented, Nov 3, 2017

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).

1reaction
nicoddemuscommented, Nov 3, 2017

Definitely @drdavella, this is on our plans, please see #2452

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found