From ce4897655252c45c71dddc3c4171a10ff01b33a8 Mon Sep 17 00:00:00 2001 From: Sergey Kim Date: Mon, 24 Apr 2023 13:16:57 +0300 Subject: [PATCH 1/6] add flake8-pytest-style to plugin_list.rst --- doc/en/reference/plugin_list.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index 40034ec10a8..c17ef9a41db 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,13 +11,14 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1243 plugins. +This list contains 1244 plugins. .. only:: not latex =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ name summary last release status requires =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ + :pypi:`flake8-pytest-style` A flake8 plugin checking common style issues or inconsistencies with pytest-based tests. Feb 15, 2023 N/A N/A :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) @@ -1266,6 +1267,13 @@ This list contains 1243 plugins. .. only:: latex + :pypi:`flake8-pytest-style` + *last release*: Feb 15, 2023, + *status*: N/A, + *requires*: N/A + + A flake8 plugin checking common style issues or inconsistencies with pytest-based tests. + :pypi:`pytest-abq` *last release*: Apr 07, 2023, *status*: N/A, From 592e0d5e662ee976c0ac6e20dfd22acf6d338eba Mon Sep 17 00:00:00 2001 From: Sergey Kim Date: Thu, 27 Apr 2023 19:57:06 +0300 Subject: [PATCH 2/6] Revert "add flake8-pytest-style to plugin_list.rst" This reverts commit ce4897655252c45c71dddc3c4171a10ff01b33a8. --- doc/en/reference/plugin_list.rst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/en/reference/plugin_list.rst b/doc/en/reference/plugin_list.rst index c17ef9a41db..40034ec10a8 100644 --- a/doc/en/reference/plugin_list.rst +++ b/doc/en/reference/plugin_list.rst @@ -11,14 +11,13 @@ automatically. Packages classified as inactive are excluded. creating a PDF, because otherwise the table gets far too wide for the page. -This list contains 1244 plugins. +This list contains 1243 plugins. .. only:: not latex =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ name summary last release status requires =============================================== ======================================================================================================================================================================================================== ============== ===================== ================================================ - :pypi:`flake8-pytest-style` A flake8 plugin checking common style issues or inconsistencies with pytest-based tests. Feb 15, 2023 N/A N/A :pypi:`pytest-abq` Pytest integration for the ABQ universal test runner. Apr 07, 2023 N/A N/A :pypi:`pytest-abstracts` A contextmanager pytest fixture for handling multiple mock abstracts May 25, 2022 N/A N/A :pypi:`pytest-accept` A pytest-plugin for updating doctest outputs Dec 21, 2022 N/A pytest (>=6,<8) @@ -1267,13 +1266,6 @@ This list contains 1244 plugins. .. only:: latex - :pypi:`flake8-pytest-style` - *last release*: Feb 15, 2023, - *status*: N/A, - *requires*: N/A - - A flake8 plugin checking common style issues or inconsistencies with pytest-based tests. - :pypi:`pytest-abq` *last release*: Apr 07, 2023, *status*: N/A, From eab0b8ede2dc19b21ede3e9bc2cb20462aaabd74 Mon Sep 17 00:00:00 2001 From: Sergey Kim Date: Thu, 27 Apr 2023 20:28:10 +0300 Subject: [PATCH 3/6] add flake8-pytest-style mention to goodpractices --- doc/en/explanation/goodpractices.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 7331a789600..5cc321f67ee 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -294,3 +294,16 @@ See also `pypa/setuptools#1684 ` setuptools intends to `remove the test command `_. + +Checking with flake8-pytest-style +--------------------------------- + +In order to ensure that ``pytest`` is being used correctly in your project, +it can be helpful to use the `flake8-pytest-style `_ plugin. + +This plugin checks for common mistakes and coding style violations in ``pytest`` code, +such as incorrect use of fixtures, test function names, and markers. +By using this plugin, you can catch these errors early in the development process +and ensure that your ``pytest`` code is consistent and easy to maintain. + +Examples of the errors that can be detected by the plugin can be found on its `PyPI page `_. From ecdcd3ab55c0d5e714d2e76b6c92d3ba2307bb01 Mon Sep 17 00:00:00 2001 From: Sergey Kim Date: Fri, 28 Apr 2023 16:05:11 +0300 Subject: [PATCH 4/6] add disclaimer about flake8-pytest-style --- doc/en/explanation/goodpractices.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 5cc321f67ee..2b180ea9777 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -307,3 +307,7 @@ By using this plugin, you can catch these errors early in the development proces and ensure that your ``pytest`` code is consistent and easy to maintain. Examples of the errors that can be detected by the plugin can be found on its `PyPI page `_. + +.. note:: + + Disclaimer: ``flake8-pytest-style`` is not an official ``pytest`` project. From ebf537fca733aff30e0585876006d6b079211eae Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 28 Apr 2023 21:46:29 +0300 Subject: [PATCH 5/6] Slight edits --- doc/en/explanation/goodpractices.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index 2b180ea9777..bcb8c1ddd4d 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -298,16 +298,16 @@ setuptools intends to Checking with flake8-pytest-style --------------------------------- -In order to ensure that ``pytest`` is being used correctly in your project, -it can be helpful to use the `flake8-pytest-style `_ plugin. +In order to ensure that pytest is being used correctly in your project, +it can be helpful to use the `flake8-pytest-style `_ flake8 plugin. -This plugin checks for common mistakes and coding style violations in ``pytest`` code, +flake8-pytest-style checks for common mistakes and coding style violations in pytest code, such as incorrect use of fixtures, test function names, and markers. By using this plugin, you can catch these errors early in the development process -and ensure that your ``pytest`` code is consistent and easy to maintain. +and ensure that your pytest code is consistent and easy to maintain. -Examples of the errors that can be detected by the plugin can be found on its `PyPI page `_. +A list of the lints detected by flake8-pytest-style can be found on its `PyPI page `_. .. note:: - Disclaimer: ``flake8-pytest-style`` is not an official ``pytest`` project. + ``flake8-pytest-style`` is not an official ``pytest`` project. From 097900d6fbc4a331b1814ddfec79e283ff47558d Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Fri, 28 Apr 2023 23:23:18 +0300 Subject: [PATCH 6/6] Update goodpractices.rst --- doc/en/explanation/goodpractices.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/explanation/goodpractices.rst b/doc/en/explanation/goodpractices.rst index bcb8c1ddd4d..efde420cd8f 100644 --- a/doc/en/explanation/goodpractices.rst +++ b/doc/en/explanation/goodpractices.rst @@ -310,4 +310,4 @@ A list of the lints detected by flake8-pytest-style can be found on its `PyPI pa .. note:: - ``flake8-pytest-style`` is not an official ``pytest`` project. + 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.