Skip to content

Commit a726044

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 4706cdd commit a726044

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ from fixture_collections import (
6767
) # <- Unused imported_fixture imported from fixture_collections
6868

6969

70-
def test_something(imported_fixture):
71-
...
70+
def test_something(imported_fixture): ...
7271
```
7372

7473
### `redefined-outer-name`
@@ -130,16 +129,14 @@ import pytest
130129

131130

132131
@pytest.fixture
133-
def awesome_fixture():
134-
...
132+
def awesome_fixture(): ...
135133

136134

137135
@pytest.fixture
138136
@pytest.mark.usefixtures(
139137
"awesome_fixture"
140138
) # <- Using useless `@pytest.mark.*` decorator for fixtures
141-
def another_awesome_fixture():
142-
...
139+
def another_awesome_fixture(): ...
143140
```
144141

145142
### W6403 `deprecated-positional-argument-for-pytest-fixture`
@@ -151,8 +148,7 @@ import pytest
151148

152149

153150
@pytest.fixture("module") # <- Using a deprecated positional arguments for fixture
154-
def awesome_fixture():
155-
...
151+
def awesome_fixture(): ...
156152
```
157153

158154
### F6401 `cannot-enumerate-pytest-fixtures`

pylint_pytest/checkers/class_attr_loader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def visit_assign(self, node: Assign):
3333
and node.value.expr.name == "request"
3434
):
3535
# storing the aliases for cls from request.cls
36-
self.request_cls = set(t.name for t in node.targets)
36+
self.request_cls = {t.name for t in node.targets}
3737

3838
def visit_assignattr(self, node):
3939
if (

pylint_pytest/checkers/fixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def visit_module(self, node):
130130

131131
FixtureChecker._pytest_fixtures = fixture_collector.fixtures
132132

133-
legitimate_failure_paths = set(
133+
legitimate_failure_paths = {
134134
collection_report.nodeid
135135
for collection_report in fixture_collector.errors
136136
if any(
@@ -140,7 +140,7 @@ def visit_module(self, node):
140140
)
141141
for pattern in FILE_NAME_PATTERNS
142142
)
143-
)
143+
}
144144
if (ret != pytest.ExitCode.OK or legitimate_failure_paths) and is_test_module:
145145
files_to_report = {
146146
str(Path(x).absolute().relative_to(Path.cwd()))

0 commit comments

Comments
 (0)