From afe0a4eecfc5e733903a9ecaf22c316946de52ff Mon Sep 17 00:00:00 2001 From: Ilaletdinov Almaz <45946541+blablatdinov@users.noreply.github.com> Date: Wed, 5 Jun 2024 12:30:02 +0300 Subject: [PATCH] Remove parenthesis for `@pytest.fixture` (#2969) * Remove parenthesis for `@pytest.fixture` * Update `flake8-pytest-style` * Use "^2.0" version for flake8-pytest-style Co-authored-by: Nikita Sobolev * Update poetry.lock --------- Co-authored-by: Nikita Sobolev --- poetry.lock | 12 ++++++------ pyproject.toml | 2 +- tests/plugins/async_sync.py | 4 ++-- tests/test_options/conftest.py | 2 +- .../test_visitors/test_ast/test_compares/conftest.py | 2 +- tests/test_visitors/test_ast/test_naming/conftest.py | 2 +- .../test_tokenize/test_comments/conftest.py | 2 +- .../test_tokenize/test_primitives/conftest.py | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7d5d2b5b3..eae4a9169 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "added-value" @@ -693,13 +693,13 @@ files = [ [[package]] name = "flake8-pytest-style" -version = "1.7.2" +version = "2.0.0" description = "A flake8 plugin checking common style issues or inconsistencies with pytest-based tests." optional = false -python-versions = ">=3.7.2,<4.0.0" +python-versions = "<4.0.0,>=3.8.1" files = [ - {file = "flake8_pytest_style-1.7.2-py3-none-any.whl", hash = "sha256:f5d2aa3219163a052dd92226589d45fab8ea027a3269922f0c4029f548ea5cd1"}, - {file = "flake8_pytest_style-1.7.2.tar.gz", hash = "sha256:b924197c99b951315949920b0e5547f34900b1844348432e67a44ab191582109"}, + {file = "flake8_pytest_style-2.0.0-py3-none-any.whl", hash = "sha256:abcb9f56f277954014b749e5a0937fae215be01a21852e9d05e7600c3de6aae5"}, + {file = "flake8_pytest_style-2.0.0.tar.gz", hash = "sha256:919c328cacd4bc4f873ea61ab4db0d8f2c32e0db09a3c73ab46b1de497556464"}, ] [package.dependencies] @@ -2628,4 +2628,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "6725236cec55b23ad9f995b6b1f0c4b9db1520ae3f8f6efb0795033f9dfb5297" +content-hash = "0dc213194998909af318703ca4ddd8c76b54b990aa0e29a208a710ce0c152bc4" diff --git a/pyproject.toml b/pyproject.toml index 37db50ff8..60b02f9e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ darglint = "^1.2" [tool.poetry.group.dev.dependencies] nitpick = "^0.35" -flake8-pytest-style = "^1.5" +flake8-pytest-style = "^2.0" pytest = "^8.1" pytest-cov = "^5.0" diff --git a/tests/plugins/async_sync.py b/tests/plugins/async_sync.py index d0e694772..e897f304f 100644 --- a/tests/plugins/async_sync.py +++ b/tests/plugins/async_sync.py @@ -1,7 +1,7 @@ import pytest -@pytest.fixture() +@pytest.fixture def async_wrapper(): """Fixture to convert all regular functions into async ones.""" def factory(template: str) -> str: @@ -15,7 +15,7 @@ def factory(template: str) -> str: return factory -@pytest.fixture() +@pytest.fixture def regular_wrapper(): """Fixture to return regular functions without modifications.""" def factory(template: str) -> str: diff --git a/tests/test_options/conftest.py b/tests/test_options/conftest.py index 390945a1b..e3893fbce 100644 --- a/tests/test_options/conftest.py +++ b/tests/test_options/conftest.py @@ -6,7 +6,7 @@ from wemake_python_styleguide.options import config -@pytest.fixture() +@pytest.fixture def option_parser(): """Returns option parser that can be used for tests.""" if flake8_version_info > (6, ): diff --git a/tests/test_visitors/test_ast/test_compares/conftest.py b/tests/test_visitors/test_ast/test_compares/conftest.py index 50b8b4a4a..defb888da 100644 --- a/tests/test_visitors/test_ast/test_compares/conftest.py +++ b/tests/test_visitors/test_ast/test_compares/conftest.py @@ -88,7 +88,7 @@ def in_conditions(request): return request.param -@pytest.fixture() +@pytest.fixture def not_in_wrapper(): """Fixture to replace all `in` operators to `not in` operators.""" def factory(template: str) -> str: diff --git a/tests/test_visitors/test_ast/test_naming/conftest.py b/tests/test_visitors/test_ast/test_naming/conftest.py index ade35ddae..4ef9e384f 100644 --- a/tests/test_visitors/test_ast/test_naming/conftest.py +++ b/tests/test_visitors/test_ast/test_naming/conftest.py @@ -392,7 +392,7 @@ def allowed_protected_unused_template(request): return request.param -@pytest.fixture() +@pytest.fixture def skip_match_case_syntax_error(): """Returns a helper that skips tests when `_` is used with pattern match.""" def factory(template: str, var_name: str) -> None: diff --git a/tests/test_visitors/test_tokenize/test_comments/conftest.py b/tests/test_visitors/test_tokenize/test_comments/conftest.py index 88e391bbf..a4b65c682 100644 --- a/tests/test_visitors/test_tokenize/test_comments/conftest.py +++ b/tests/test_visitors/test_tokenize/test_comments/conftest.py @@ -7,7 +7,7 @@ MODE_NON_EXECUTABLE = 0o644 -@pytest.fixture() +@pytest.fixture def make_file(tmp_path): """Fixture to make a temporary executable or non executable file.""" def factory( diff --git a/tests/test_visitors/test_tokenize/test_primitives/conftest.py b/tests/test_visitors/test_tokenize/test_primitives/conftest.py index 78ebfce17..b13e3eb53 100644 --- a/tests/test_visitors/test_tokenize/test_primitives/conftest.py +++ b/tests/test_visitors/test_tokenize/test_primitives/conftest.py @@ -21,7 +21,7 @@ def primitives_usages(request): return request.param -@pytest.fixture() +@pytest.fixture def regular_number_wrapper(): """Fixture to return regular numbers without modifications.""" def factory(template: str) -> str: @@ -29,7 +29,7 @@ def factory(template: str) -> str: return factory -@pytest.fixture() +@pytest.fixture def negative_number_wrapper(): """Fixture to return negative numbers.""" def factory(template: str) -> str: @@ -37,7 +37,7 @@ def factory(template: str) -> str: return factory -@pytest.fixture() +@pytest.fixture def positive_number_wrapper(): """Fixture to return positive numbers with explicit ``+``.""" def factory(template: str) -> str: