8000 Don't import anything from `typing.py` in our tests (#387) · python/typing_extensions@08c066e · GitHub
[go: up one dir, main page]

Skip to content

Commit 08c066e

Browse files
authored
Don't import anything from typing.py in our tests (#387)
1 parent a370bf6 commit 08c066e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/test_typing_extensions.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
from unittest import TestCase, main, skipUnless, skipIf
2222
from unittest.mock import patch
2323
import typing
24-
from typing import Optional, Union, AnyStr
25-
from typing import T, KT, VT # Not in __all__.
26-
from typing import Tuple, List, Set, Dict, Iterable, Iterator, Callable
27-
from typing import Generic
28-
from typing import no_type_check
2924
import warnings
3025

3126
import typing_extensions
@@ -36,12 +31,15 @@
3631
from typing_extensions import TypeVarTuple, Unpack, dataclass_transform, reveal_type, Never, assert_never, LiteralString
3732
from typing_extensions import assert_type, get_type_hints, get_origin, get_args, get_original_bases
3833
from typing_extensions import clear_overloads, get_overloads, overload
39-
from typing_extensions import NamedTuple, TypeIs
34+
from typing_extensions import NamedTuple, TypeIs, no_type_check, Dict
4035
from typing_extensions import override, deprecated, Buffer, TypeAliasType, TypeVar, get_protocol_members, is_protocol
41-
from typing_extensions import Doc, NoDefault
36+
from typing_extensions import Doc, NoDefault, List, Union, AnyStr, Iterable, Generic, Optional, Set, Tuple, Callable
4237
from _typed_dict_test_helper import Foo, FooGeneric, VeryAnnotated
4338

4439
NoneType = type(None)
40+
T = TypeVar("T")
41+
KT = TypeVar("KT")
42+
VT = TypeVar("VT")
4543

4644
# Flags used to mark tests that only apply after a specific
4745
# version of the typing module.
@@ -67,7 +65,7 @@
6765
)
6866

6967
ANN_MODULE_SOURCE = '''\
70-
from typing import Optional
68+
from typing import List, Optional
7169
from functools import wraps
7270
7371
__annotations__[1] = 2

0 commit comments

Comments
 (0)
0