{"id":24426,"library":"pytest-flakes","title":"pytest-flakes","description":"A pytest plugin that checks Python source code for logical errors using pyflakes. It integrates seamlessly into the pytest ecosystem, automatically running pyflakes on all collected test files and source files. Current version 4.0.5 supports Python >=3.5. The plugin is in maintenance mode; no new features are expected.","status":"active","version":"4.0.5","language":"python","source_language":"en","source_url":"https://github.com/asmeurer/pytest-flakes","tags":["pytest-plugin","pyflakes","linting","testing"],"install":[{"cmd":"pip install pytest-flakes","lang":"bash","label":"pip"}],"dependencies":[{"reason":"Required to run the plugin","package":"pytest","optional":false},{"reason":"Core dependency for code checking","package":"pyflakes","optional":false}],"imports":[{"note":"Common mistake: users try to import submodules, but the plugin is automatically registered when installed.","wrong":"from pytest_flakes import ...","symbol":"pytest_flakes","correct":"import pytest_flakes"}],"quickstart":{"code":"import pytest\nimport sys\nsys.path.insert(0, 'src')\n\ndef test_ok():\n    x = 1\n    assert x","lang":"python","description":"Create a test file (e.g., test_demo.py). Run pytest normally. The plugin will automatically check all Python files for pyflakes errors."},"warnings":[{"fix":"Configure pytest.ini with flakes-ignore = path/to/ignore*","message":"The plugin checks all collected Python files, not just test files. This can cause unexpected failures in third-party code if you have a large source tree. Use --flakes-ignore to exclude files.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using flake8 for modern Python syntax support.","message":"Does not work with Python 3.10+? Actually, pyflakes supports up to Python 3.8. But pytest-flakes may still work with newer Python as long as pyflakes parses the code. However, there may be false negatives for newer syntax (match statements, etc.).","severity":"gotcha","affected_versions":"4.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install pyflakes","cause":"Missing dependency pyflakes","error":"ModuleNotFoundError: No module named 'pyflakes'"},{"fix":"pip install pytest-flakes and ensure it's in the test environment","cause":"pytest-flakes is not installed or not activated","error":"ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]\npytest: error: unrecognized arguments: --flakes"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}