flake8-pytest-style is a flake8 plugin designed to enforce common style guidelines and identify inconsistencies within pytest-based test suites. It helps maintain clean and idiomatic pytest code by reporting a variety of style violations. The current version is 2.2.0, released in October 2025, and it maintains a somewhat regular release cadence, with major/minor updates typically every 3-9 months.
pip install flake8-pytest-styleVerified import paths — ran on the pinned version, not inferred.
Install the plugin, then run `flake8` as you normally would. The plugin automatically integrates with flake8 to check pytest-related style issues in your project.
If you experience new PT001 or PT023 violations, you may need to explicitly configure these options in your `flake8` configuration (e.g., `setup.cfg`, `pyproject.toml`) to match your preferred style, or update your code to include/remove parentheses as per the new default.
Ensure your project's Python environment meets the minimum version requirement for the `flake8-pytest-style` version you are using. Update your Python environment if necessary.
While `flake8-pytest-style` still reports these, consider if these specific rules fit your project's conventions. You can selectively ignore them via `flake8` configuration if they conflict with your established patterns or other linter's recommendations.
Remove default values from test function parameters that are intended to receive fixtures. Fixtures should be injected without an explicit default.