fixup: remove remove unused alias in code

This commit is contained in:
Ronny Pfannschmidt
2024-06-20 12:05:10 +02:00
parent 2a75bab290
commit 8e495e32c6
242 changed files with 1962 additions and 1780 deletions

View File

@@ -1,4 +1,6 @@
# mypy: allow-untyped-defs
from __future__ import annotations
import dataclasses
import itertools
import re
@@ -8,11 +10,7 @@ from typing import Any
from typing import cast
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import Sequence
from typing import Tuple
from typing import Union
import hypothesis
from hypothesis import strategies
@@ -35,7 +33,7 @@ class TestMetafunc:
# on the funcarg level, so we don't need a full blown
# initialization.
class FuncFixtureInfoMock:
name2fixturedefs: Dict[str, List[fixtures.FixtureDef[object]]] = {}
name2fixturedefs: dict[str, list[fixtures.FixtureDef[object]]] = {}
def __init__(self, names):
self.names_closure = names
@@ -101,7 +99,7 @@ class TestMetafunc:
def __repr__(self):
return "Exc(from_gen)"
def gen() -> Iterator[Union[int, None, Exc]]:
def gen() -> Iterator[int | None | Exc]:
yield 0
yield None
yield Exc()
@@ -346,7 +344,7 @@ class TestMetafunc:
option = "disable_test_id_escaping_and_forfeit_all_rights_to_community_support"
values: List[Tuple[str, Any, str]] = [
values: list[tuple[str, Any, str]] = [
("ação", MockConfig({option: True}), "ação"),
("ação", MockConfig({option: False}), "a\\xe7\\xe3o"),
]
@@ -516,7 +514,7 @@ class TestMetafunc:
def test_idmaker_idfn(self) -> None:
"""#351"""
def ids(val: object) -> Optional[str]:
def ids(val: object) -> str | None:
if isinstance(val, Exception):
return repr(val)
return None
@@ -579,7 +577,7 @@ class TestMetafunc:
option = "disable_test_id_escaping_and_forfeit_all_rights_to_community_support"
values: List[Tuple[Any, str]] = [
values: list[tuple[Any, str]] = [
(MockConfig({option: True}), "ação"),
(MockConfig({option: False}), "a\\xe7\\xe3o"),
]
@@ -617,7 +615,7 @@ class TestMetafunc:
option = "disable_test_id_escaping_and_forfeit_all_rights_to_community_support"
values: List[Tuple[Any, str]] = [
values: list[tuple[Any, str]] = [
(MockConfig({option: True}), "ação"),
(MockConfig({option: False}), "a\\xe7\\xe3o"),
]
@@ -1748,9 +1746,9 @@ class TestMetafuncFunctionalAuto:
self, pytester: Pytester, monkeypatch
) -> None:
"""Integration test for (#3941)"""
class_fix_setup: List[object] = []
class_fix_setup: list[object] = []
monkeypatch.setattr(sys, "class_fix_setup", class_fix_setup, raising=False)
func_fix_setup: List[object] = []
func_fix_setup: list[object] = []
monkeypatch.setattr(sys, "func_fix_setup", func_fix_setup, raising=False)
pytester.makepyfile(