RFC: from __future__ import annotations + migrate
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# mypy: allow-untyped-defs
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
from types import ModuleType
|
||||
from typing import List
|
||||
|
||||
from _pytest.config import ExitCode
|
||||
from _pytest.config import PytestPluginManager
|
||||
@@ -227,7 +228,7 @@ class TestInlineRunModulesCleanup:
|
||||
|
||||
def spy_factory(self):
|
||||
class SysModulesSnapshotSpy:
|
||||
instances: List["SysModulesSnapshotSpy"] = []
|
||||
instances: list[SysModulesSnapshotSpy] = []
|
||||
|
||||
def __init__(self, preserve=None) -> None:
|
||||
SysModulesSnapshotSpy.instances.append(self)
|
||||
@@ -399,7 +400,7 @@ class TestSysPathsSnapshot:
|
||||
original_data = list(getattr(sys, path_type))
|
||||
original_other = getattr(sys, other_path_type)
|
||||
original_other_data = list(original_other)
|
||||
new: List[object] = []
|
||||
new: list[object] = []
|
||||
snapshot = SysPathsSnapshot()
|
||||
monkeypatch.setattr(sys, path_type, new)
|
||||
snapshot.restore()
|
||||
|
||||
Reference in New Issue
Block a user