Skip to content

Commit f7eabe2

Browse files
committed
WIP enable flake8-pytest-style
1 parent b324b3a commit f7eabe2

File tree

8 files changed

+12
-11
lines changed

8 files changed

+12
-11
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ select = [
2727
"F", # pyflakes
2828
"I", # isort
2929
"YTT", # flake8-2020
30+
"PT", # flake8-pytest-style
3031
]
3132
extend-ignore = [
3233
'F403', # undefined-local-with-import-star

trio/_core/_tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def drain_socket(sock: stdlib_socket.socket) -> None:
4242
RetT = TypeVar("RetT")
4343

4444

45-
@pytest.fixture
45+
@pytest.fixture()
4646
def socketpair() -> Generator[SocketPair, None, None]:
4747
pair = stdlib_socket.socketpair()
4848
for sock in pair:

trio/_tests/pytest_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ def pytest_configure(config: pytest.Config) -> None:
2727
SKIP_OPTIONAL_IMPORTS = config.getoption("--skip-optional-imports", default=False)
2828

2929

30-
@pytest.fixture
30+
@pytest.fixture()
3131
def mock_clock() -> MockClock:
3232
return MockClock()
3333

3434

35-
@pytest.fixture
35+
@pytest.fixture()
3636
def autojump_clock() -> MockClock:
3737
return MockClock(autojump_threshold=0)
3838

trio/_tests/test_deprecate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from . import module_with_deprecations
1515

1616

17-
@pytest.fixture
17+
@pytest.fixture()
1818
def recwarn_always(recwarn: pytest.WarningsRecorder) -> pytest.WarningsRecorder:
1919
warnings.simplefilter("always")
2020
# ResourceWarnings about unclosed sockets can occur nondeterministically

trio/_tests/test_exports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def iter_modules(
113113
# they might be using a newer version of Python with additional symbols which
114114
# won't be reflected in trio.socket, and this shouldn't cause downstream test
115115
# runs to start failing.
116-
@pytest.mark.redistributors_should_skip
116+
@pytest.mark.redistributors_should_skip()
117117
# Static analysis tools often have trouble with alpha releases, where Python's
118118
# internals are in flux, grammar may not have settled down, etc.
119119
@pytest.mark.skipif(
@@ -263,7 +263,7 @@ def no_underscores(symbols):
263263
# modules, instead of once per class.
264264
@slow
265265
# see comment on test_static_tool_sees_all_symbols
266-
@pytest.mark.redistributors_should_skip
266+
@pytest.mark.redistributors_should_skip()
267267
# Static analysis tools often have trouble with alpha releases, where Python's
268268
# internals are in flux, grammar may not have settled down, etc.
269269
@pytest.mark.skipif(

trio/_tests/test_file_io.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
from trio._file_io import _FILE_ASYNC_METHODS, _FILE_SYNC_ATTRS, AsyncIOWrapper
1515

1616

17-
@pytest.fixture
17+
@pytest.fixture()
1818
def path(tmp_path: pathlib.Path) -> str:
1919
return os.fspath(tmp_path / "test")
2020

2121

22-
@pytest.fixture
22+
@pytest.fixture()
2323
def wrapped():
2424
return mock.Mock(spec_set=io.StringIO)
2525

2626

27-
@pytest.fixture
27+
@pytest.fixture()
2828
def async_file(wrapped):
2929
return trio.wrap_file(wrapped)
3030

trio/_tests/test_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from trio._path import AsyncAutoWrapperType as WrapperType
1313

1414

15-
@pytest.fixture
15+
@pytest.fixture()
1616
def path(tmp_path: pathlib.Path) -> trio.Path:
1717
return trio.Path(tmp_path / "test")
1818

trio/_tests/test_socket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def getaddrinfo(self, *args: Any, **kwargs: Any) -> getaddrinfoResponse | str:
6969
raise RuntimeError(f"gai called with unexpected arguments {bound}")
7070

7171

72-
@pytest.fixture
72+
@pytest.fixture()
7373
def monkeygai(monkeypatch: pytest.MonkeyPatch) -> MonkeypatchedGAI:
7474
controller = MonkeypatchedGAI(stdlib_socket.getaddrinfo)
7575
monkeypatch.setattr(stdlib_socket, "getaddrinfo", controller.getaddrinfo)

0 commit comments

Comments
 (0)