Skip to content

Commit

Permalink
Run pyupgrade --py39-plus on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Dec 7, 2024
1 parent 6dc8c2a commit 475b346
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/xdist/_path.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from collections.abc import Iterator
from itertools import chain
import os
from pathlib import Path
from typing import Callable
from typing import Iterator


def visit_path(
Expand Down
2 changes: 1 addition & 1 deletion src/xdist/dsession.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import annotations

from collections.abc import Sequence
from enum import auto
from enum import Enum
from queue import Empty
from queue import Queue
import sys
from typing import Any
from typing import Sequence
import warnings

import execnet
Expand Down
6 changes: 3 additions & 3 deletions src/xdist/looponfail.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

from __future__ import annotations

from collections.abc import Sequence
import os
from pathlib import Path
import sys
import time
from typing import Any
from typing import Sequence

from _pytest._io import TerminalWriter
import execnet
Expand Down Expand Up @@ -158,9 +158,9 @@ def repr_pytest_looponfailinfo(


def init_worker_session(
channel: "execnet.Channel", # noqa: UP037
channel: execnet.Channel,
args: list[str],
option_dict: dict[str, "Any"], # noqa: UP037
option_dict: dict[str, Any],
) -> None:
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion src/xdist/newhooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

from __future__ import annotations

from collections.abc import Sequence
import os
from typing import Any
from typing import Sequence
from typing import TYPE_CHECKING

import execnet
Expand Down
8 changes: 4 additions & 4 deletions src/xdist/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
from __future__ import annotations

import collections
from collections.abc import Generator
from collections.abc import Iterable
from collections.abc import Sequence
import contextlib
import enum
import os
import sys
import time
from typing import Any
from typing import Generator
from typing import Iterable
from typing import Literal
from typing import Sequence
from typing import TypedDict
from typing import Union
import warnings
Expand Down Expand Up @@ -98,7 +98,7 @@ def replace(self, iterable: Iterable[Item]) -> None:
self._items = collections.deque(iterable)

@contextlib.contextmanager
def lock(self) -> Generator[collections.deque[Item], None, None]:
def lock(self) -> Generator[collections.deque[Item]]:
with self._lock:
try:
yield self._items
Expand Down
2 changes: 1 addition & 1 deletion src/xdist/report.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Sequence
from difflib import unified_diff
from typing import Sequence


def report_collection_diff(
Expand Down
2 changes: 1 addition & 1 deletion src/xdist/scheduler/each.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Sequence
from collections.abc import Sequence

import pytest

Expand Down
2 changes: 1 addition & 1 deletion src/xdist/scheduler/load.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Sequence
from itertools import cycle
from typing import Sequence

import pytest

Expand Down
2 changes: 1 addition & 1 deletion src/xdist/scheduler/loadscope.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections import OrderedDict
from collections.abc import Sequence
from typing import NoReturn
from typing import Sequence

import pytest

Expand Down
2 changes: 1 addition & 1 deletion src/xdist/scheduler/protocol.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Sequence
from typing import Protocol
from typing import Sequence

from xdist.workermanage import WorkerController

Expand Down
2 changes: 1 addition & 1 deletion src/xdist/scheduler/worksteal.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from collections.abc import Sequence
from typing import NamedTuple
from typing import Sequence

import pytest

Expand Down
2 changes: 1 addition & 1 deletion src/xdist/workermanage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from collections.abc import Sequence
import enum
import fnmatch
import os
Expand All @@ -9,7 +10,6 @@
from typing import Any
from typing import Callable
from typing import Literal
from typing import Sequence
from typing import Union
import uuid
import warnings
Expand Down
4 changes: 2 additions & 2 deletions testing/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Generator
import shutil
from typing import Callable
from typing import Generator

import execnet
import pytest
Expand All @@ -12,7 +12,7 @@


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

finalizers = []
Expand Down
2 changes: 1 addition & 1 deletion testing/test_dsession.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Sequence
from typing import Any
from typing import cast
from typing import Sequence
from typing import TYPE_CHECKING

import execnet
Expand Down
3 changes: 1 addition & 2 deletions testing/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import Any
from typing import Callable
from typing import cast
from typing import Dict
from typing import Union
import uuid

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

class TestWorkerInteractor:
UnserializerReport = Callable[
[Dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
[dict[str, Any]], Union[pytest.CollectReport, pytest.TestReport]
]

@pytest.fixture
Expand Down

0 comments on commit 475b346

Please sign in to comment.