Skip to content

Commit 725de3a

Browse files
authored
add flake8-pytest-style mention to goodpractices (pytest-dev#10939)
1 parent a15f544 commit 725de3a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

doc/en/explanation/goodpractices.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,20 @@ See also `pypa/setuptools#1684 <https://github.com/pypa/setuptools/issues/1684>`
294294

295295
setuptools intends to
296296
`remove the test command <https://github.com/pypa/setuptools/issues/931>`_.
297+
298+
Checking with flake8-pytest-style
299+
---------------------------------
300+
301+
In order to ensure that pytest is being used correctly in your project,
302+
it can be helpful to use the `flake8-pytest-style <https://github.com/m-burst/flake8-pytest-style>`_ flake8 plugin.
303+
304+
flake8-pytest-style checks for common mistakes and coding style violations in pytest code,
305+
such as incorrect use of fixtures, test function names, and markers.
306+
By using this plugin, you can catch these errors early in the development process
307+
and ensure that your pytest code is consistent and easy to maintain.
308+
309+
A list of the lints detected by flake8-pytest-style can be found on its `PyPI page <https://pypi.org/project/flake8-pytest-style/>`_.
310+
311+
.. note::
312+
313+
flake8-pytest-style is not an official pytest project. Some of the rules enforce certain style choices, such as using `@pytest.fixture()` over `@pytest.fixture`, but you can configure the plugin to fit your preferred style.

0 commit comments

Comments
 (0)