Skip to content

Commit

Permalink
Remove parenthesis for @pytest.fixture (#2969)
Browse files Browse the repository at this point in the history
* Remove parenthesis for `@pytest.fixture`

* Update `flake8-pytest-style`

* Use "^2.0" version for flake8-pytest-style

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

* Update poetry.lock

---------

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
  • Loading branch information
blablatdinov and sobolevn authored Jun 5, 2024
1 parent be8d52c commit afe0a4e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions tests/plugins/async_sync.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_options/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, ):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_visitors/test_ast/test_compares/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_visitors/test_ast/test_naming/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tests/test_visitors/test_tokenize/test_primitives/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ 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:
return template
return factory


@pytest.fixture()
@pytest.fixture
def negative_number_wrapper():
"""Fixture to return negative numbers."""
def factory(template: str) -> str:
return '-{0}'.format(template)
return factory


@pytest.fixture()
@pytest.fixture
def positive_number_wrapper():
"""Fixture to return positive numbers with explicit ``+``."""
def factory(template: str) -> str:
Expand Down

0 comments on commit afe0a4e

Please sign in to comment.