unittest: Use a recursive type alias for assertIsInstance (#9770)

This commit is contained in:
Alex Waygood
2023-02-20 15:35:50 +00:00
committed by GitHub
parent 5e6b172e17
commit 4273a83bb7
2 changed files with 8 additions and 4 deletions

View File

@@ -1394,6 +1394,7 @@ def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]:
@overload
def iter(__function: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ...
# Keep this alias in sync with unittest.case._ClassInfo
if sys.version_info >= (3, 10):
_ClassInfo: TypeAlias = type | types.UnionType | tuple[_ClassInfo, ...]
else: