RFC: from __future__ import annotations + migrate

This commit is contained in:
Ronny Pfannschmidt
2024-06-17 17:01:28 +02:00
parent 20dd1d6738
commit 9295f9ffff
242 changed files with 1961 additions and 1777 deletions

View File

@@ -1,3 +1,5 @@
from __future__ import annotations
from enum import auto
from enum import Enum
import os
@@ -5,9 +7,7 @@ from pathlib import Path
import shutil
from typing import Any
from typing import Generator
from typing import List
from typing import Sequence
from typing import Tuple
from _pytest.compat import assert_never
from _pytest.config import ExitCode
@@ -579,7 +579,7 @@ class TestLastFailed:
def rlf(
fail_import: int, fail_run: int, args: Sequence[str] = ()
) -> Tuple[Any, Any]:
) -> tuple[Any, Any]:
monkeypatch.setenv("FAILIMPORT", str(fail_import))
monkeypatch.setenv("FAILTEST", str(fail_run))
@@ -693,7 +693,7 @@ class TestLastFailed:
else:
assert "rerun previous" in result.stdout.str()
def get_cached_last_failed(self, pytester: Pytester) -> List[str]:
def get_cached_last_failed(self, pytester: Pytester) -> list[str]:
config = pytester.parseconfigure()
assert config.cache is not None
return sorted(config.cache.get("cache/lastfailed", {}))