{"id":24440,"library":"pytest-warnings","title":"pytest-warnings","description":"A pytest plugin that lists Python warnings in the pytest report. Version 0.3.1. Low release cadence, last updated in 2020.","status":"maintenance","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/fschulze/pytest-warnings","tags":["pytest","warnings","testing"],"install":[{"cmd":"pip install pytest-warnings","lang":"bash","label":"pip"}],"dependencies":[],"imports":[{"note":"This is a pytest plugin, not a direct import. It is automatically loaded when installed, or can be explicitly declared in conftest.py.","wrong":"import pytest_warnings","symbol":"pytest-warnings","correct":"pytest_plugins = ['pytest_warnings']"}],"quickstart":{"code":"# conftest.py\npytest_plugins = ['pytest_warnings']\n\n# Then run pytest normally; warnings will appear in the report summary.","lang":"python","description":"Enable the plugin in conftest.py to include warnings in the pytest report."},"warnings":[{"fix":"Use `pytest -W error::UserWarning` or configure `filterwarnings` in pytest.ini.","message":"pytest-warnings is largely superseded by built-in '-W' flag and pytest's native warning capture. Consider using native pytest features.","severity":"deprecated","affected_versions":"all"},{"fix":"Use underscore in conftest.py: `pytest_plugins = ['pytest_warnings']`.","message":"The plugin is imported via 'pytest_warnings' (underscore) but installed as 'pytest-warnings' (hyphen).","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade pytest or add `-p no:warnings` temporarily to disable. Check if the plugin is compatible with your pytest version.","cause":"Potential conflict with other plugins or pytest version. The plugin may add arguments that conflict.","error":"ERROR: usage: pytest [options] [file_or_dir] [...] pytest: error: unrecognized arguments: --no-header"},{"fix":"Run `pip install pytest-warnings` and ensure the name in conftest.py is `pytest_warnings`.","cause":"Package not installed or misspelled in conftest.py.","error":"ModuleNotFoundError: No module named 'pytest_warnings'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}