Skip to content

Commit 475b346

Browse files
committed
Run pyupgrade --py39-plus on all files
1 parent 6dc8c2a commit 475b346

15 files changed

+21
-22
lines changed

src/xdist/_path.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
from collections.abc import Iterator
12
from itertools import chain
23
import os
34
from pathlib import Path
45
from typing import Callable
5-
from typing import Iterator
66

77

88
def visit_path(

src/xdist/dsession.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from enum import auto
45
from enum import Enum
56
from queue import Empty
67
from queue import Queue
78
import sys
89
from typing import Any
9-
from typing import Sequence
1010
import warnings
1111

1212
import execnet

src/xdist/looponfail.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
from __future__ import annotations
1111

12+
from collections.abc import Sequence
1213
import os
1314
from pathlib import Path
1415
import sys
1516
import time
1617
from typing import Any
17-
from typing import Sequence
1818

1919
from _pytest._io import TerminalWriter
2020
import execnet
@@ -158,9 +158,9 @@ def repr_pytest_looponfailinfo(
158158

159159

160160
def init_worker_session(
161-
channel: "execnet.Channel", # noqa: UP037
161+
channel: execnet.Channel,
162162
args: list[str],
163-
option_dict: dict[str, "Any"], # noqa: UP037
163+
option_dict: dict[str, Any],
164164
) -> None:
165165
import os
166166
import sys

src/xdist/newhooks.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
from __future__ import annotations
1616

17+
from collections.abc import Sequence
1718
import os
1819
from typing import Any
19-
from typing import Sequence
2020
from typing import TYPE_CHECKING
2121

2222
import execnet

src/xdist/remote.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
from __future__ import annotations
1010

1111
import collections
12+
from collections.abc import Generator
13+
from collections.abc import Iterable
14+
from collections.abc import Sequence
1215
import contextlib
1316
import enum
1417
import os
1518
import sys
1619
import time
1720
from typing import Any
18-
from typing import Generator
19-
from typing import Iterable
2021
from typing import Literal
21-
from typing import Sequence
2222
from typing import TypedDict
2323
from typing import Union
2424
import warnings
@@ -98,7 +98,7 @@ def replace(self, iterable: Iterable[Item]) -> None:
9898
self._items = collections.deque(iterable)
9999

100100
@contextlib.contextmanager
101-
def lock(self) -> Generator[collections.deque[Item], None, None]:
101+
def lock(self) -> Generator[collections.deque[Item]]:
102102
with self._lock:
103103
try:
104104
yield self._items

src/xdist/report.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from difflib import unified_diff
4-
from typing import Sequence
55

66

77
def report_collection_diff(

src/xdist/scheduler/each.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Sequence
3+
from collections.abc import Sequence
44

55
import pytest
66

src/xdist/scheduler/load.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from itertools import cycle
4-
from typing import Sequence
55

66
import pytest
77

src/xdist/scheduler/loadscope.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

33
from collections import OrderedDict
4+
from collections.abc import Sequence
45
from typing import NoReturn
5-
from typing import Sequence
66

77
import pytest
88

src/xdist/scheduler/protocol.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import Protocol
4-
from typing import Sequence
55

66
from xdist.workermanage import WorkerController
77

src/xdist/scheduler/worksteal.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import NamedTuple
4-
from typing import Sequence
55

66
import pytest
77

src/xdist/workermanage.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
import enum
45
import fnmatch
56
import os
@@ -9,7 +10,6 @@
910
from typing import Any
1011
from typing import Callable
1112
from typing import Literal
12-
from typing import Sequence
1313
from typing import Union
1414
import uuid
1515
import warnings

testing/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Generator
34
import shutil
45
from typing import Callable
5-
from typing import Generator
66

77
import execnet
88
import pytest
@@ -12,7 +12,7 @@
1212

1313

1414
@pytest.fixture(autouse=True)
15-
def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None, None, None]:
15+
def _divert_atexit(monkeypatch: pytest.MonkeyPatch) -> Generator[None]:
1616
import atexit
1717

1818
finalizers = []

testing/test_dsession.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22

3+
from collections.abc import Sequence
34
from typing import Any
45
from typing import cast
5-
from typing import Sequence
66
from typing import TYPE_CHECKING
77

88
import execnet

testing/test_remote.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from typing import Any
88
from typing import Callable
99
from typing import cast
10-
from typing import Dict
1110
from typing import Union
1211
import uuid
1312

@@ -90,7 +89,7 @@ def worker(request: pytest.FixtureRequest, pytester: pytest.Pytester) -> WorkerS
9089

9190
class TestWorkerInteractor:
9291
UnserializerReport = Callable[
93-
[Dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
92+
[dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
9493
]
9594

9695
@pytest.fixture

0 commit comments

Comments
 (0)