@@ -3513,11 +3513,10 @@ def test_container(self):
3513
3513
self .assertNotIsInstance (42 , typing .Container )
3514
3514
3515
3515
def test_collection (self ):
3516
- if hasattr (typing , 'Collection' ):
3517
- self .assertIsInstance (tuple (), typing .Collection )
3518
- self .assertIsInstance (frozenset (), typing .Collection )
3519
- self .assertIsSubclass (dict , typing .Collection )
3520
- self .assertNotIsInstance (42 , typing .Collection )
3516
+ self .assertIsInstance (tuple (), typing .Collection )
3517
+ self .assertIsInstance (frozenset (), typing .Collection )
3518
+ self .assertIsSubclass (dict , typing .Collection )
3519
+ self .assertNotIsInstance (42 , typing .Collection )
3521
3520
3522
3521
def test_abstractset (self ):
3523
3522
self .assertIsInstance (set (), typing .AbstractSet )
@@ -5130,8 +5129,9 @@ def test_all(self):
5130
5129
self .assertIn ('ValuesView' , a )
5131
5130
self .assertIn ('cast' , a )
5132
5131
self .assertIn ('overload' , a )
5133
- if hasattr (contextlib , 'AbstractContextManager' ):
5134
- self .assertIn ('ContextManager' , a )
5132
+ # Context managers.
5133
+ self .assertIn ('ContextManager' , a )
5134
+ self .assertIn ('AsyncContextManager' , a )
5135
5135
# Check that io and re are not exported.
5136
5136
self .assertNotIn ('io' , a )
5137
5137
self .assertNotIn ('re' , a )
@@ -5145,8 +5145,6 @@ def test_all(self):
5145
5145
self .assertIn ('SupportsComplex' , a )
5146
5146
5147
5147
def test_all_exported_names (self ):
5148
- import typing
5149
-
5150
5148
actual_all = set (typing .__all__ )
5151
5149
computed_all = {
5152
5150
k for k , v in vars (typing ).items ()
0 commit comments