diff options
author | Anthony Sottile <asottile@umich.edu> | 2020-10-02 13:02:22 -0700 |
---|---|---|
committer | Anthony Sottile <asottile@umich.edu> | 2020-10-02 19:50:10 -0700 |
commit | bfadd4060e83a7c8dc6233643ad9fa4af7368806 (patch) | |
tree | 10b6915916b780d53eacec59193028918cea0598 /src/_pytest/_code | |
parent | a23666d55494f6960dfc8845757c391b5aedec0b (diff) | |
download | pytest-bfadd4060e83a7c8dc6233643ad9fa4af7368806.tar.gz |
py36+: from typing import Type: no longer need guard
Diffstat (limited to 'src/_pytest/_code')
-rw-r--r-- | src/_pytest/_code/code.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 65b2bd638..ce63b4b16 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -21,6 +21,7 @@ from typing import Pattern from typing import Sequence from typing import Set from typing import Tuple +from typing import Type from typing import TYPE_CHECKING from typing import TypeVar from typing import Union @@ -44,7 +45,6 @@ from _pytest.compat import overload from _pytest.pathlib import Path if TYPE_CHECKING: - from typing import Type from typing_extensions import Literal from weakref import ReferenceType @@ -421,14 +421,14 @@ class ExceptionInfo(Generic[_E]): _assert_start_repr = "AssertionError('assert " - _excinfo = attr.ib(type=Optional[Tuple["Type[_E]", "_E", TracebackType]]) + _excinfo = attr.ib(type=Optional[Tuple[Type["_E"], "_E", TracebackType]]) _striptext = attr.ib(type=str, default="") _traceback = attr.ib(type=Optional[Traceback], default=None) @classmethod def from_exc_info( cls, - exc_info: Tuple["Type[_E]", "_E", TracebackType], + exc_info: Tuple[Type[_E], _E, TracebackType], exprinfo: Optional[str] = None, ) -> "ExceptionInfo[_E]": """Return an ExceptionInfo for an existing exc_info tuple. @@ -479,13 +479,13 @@ class ExceptionInfo(Generic[_E]): """Return an unfilled ExceptionInfo.""" return cls(None) - def fill_unfilled(self, exc_info: Tuple["Type[_E]", _E, TracebackType]) -> None: + def fill_unfilled(self, exc_info: Tuple[Type[_E], _E, TracebackType]) -> None: """Fill an unfilled ExceptionInfo created with ``for_later()``.""" assert self._excinfo is None, "ExceptionInfo was already filled" self._excinfo = exc_info @property - def type(self) -> "Type[_E]": + def type(self) -> Type[_E]: """The exception class.""" assert ( self._excinfo is not None @@ -551,7 +551,7 @@ class ExceptionInfo(Generic[_E]): return text def errisinstance( - self, exc: Union["Type[BaseException]", Tuple["Type[BaseException]", ...]] + self, exc: Union[Type[BaseException], Tuple[Type[BaseException], ...]] ) -> bool: """Return True if the exception is an instance of exc. |