Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/test_typing_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,14 +930,14 @@ def test_coroutine(self):
pass

def test_async_iterable(self):
base_it = range(10) # type: Iterator[int]
base_it: Iterator[int] = range(10)
it = AsyncIteratorWrapper(base_it)
self.assertIsInstance(it, typing_extensions.AsyncIterable)
self.assertIsInstance(it, typing_extensions.AsyncIterable)
self.assertNotIsInstance(42, typing_extensions.AsyncIterable)

def test_async_iterator(self):
base_it = range(10) # type: Iterator[int]
base_it: Iterator[int] = range(10)
it = AsyncIteratorWrapper(base_it)
self.assertIsInstance(it, typing_extensions.AsyncIterator)
self.assertNotIsInstance(42, typing_extensions.AsyncIterator)
Expand Down Expand Up @@ -1697,7 +1697,7 @@ class Concrete(Proto):
def test_none_treated_correctly(self):
@runtime
class P(Protocol):
x = None # type: int
x: int = None
class B(object): pass
self.assertNotIsInstance(B(), P)
class C:
Expand All @@ -1717,7 +1717,7 @@ def __init__(self):

def test_protocols_in_unions(self):
class P(Protocol):
x = None # type: int
x: int = None
Alias = typing.Union[typing.Iterable, P]
Alias2 = typing.Union[P, typing.Iterable]
self.assertEqual(Alias, Alias2)
Expand Down Expand Up @@ -2388,7 +2388,7 @@ def test_canonical_usage_with_variable_annotation(self):
exec('Alias: TypeAlias = Employee', globals(), ns)

def test_canonical_usage_with_type_comment(self):
Alias = Employee # type: TypeAlias
Alias: TypeAlias = Employee

def test_cannot_instantiate(self):
with self.assertRaises(TypeError):
Expand Down