@@ -3230,11 +3230,10 @@ def test_container(self):
3230
3230
self .assertNotIsInstance (42 , typing .Container )
3231
3231
3232
3232
def test_collection (self ):
3233
- if hasattr (typing , 'Collection' ):
3234
- self .assertIsInstance (tuple (), typing .Collection )
3235
- self .assertIsInstance (frozenset (), typing .Collection )
3236
- self .assertIsSubclass (dict , typing .Collection )
3237
- self .assertNotIsInstance (42 , typing .Collection )
3233
+ self .assertIsInstance (tuple (), typing .Collection )
3234
+ self .assertIsInstance (frozenset (), typing .Collection )
3235
+ self .assertIsSubclass (dict , typing .Collection )
3236
+ self .assertNotIsInstance (42 , typing .Collection )
3238
3237
3239
3238
def test_abstractset (self ):
3240
3239
self .assertIsInstance (set (), typing .AbstractSet )
@@ -4321,8 +4320,9 @@ def test_all(self):
4321
4320
self .assertIn ('ValuesView' , a )
4322
4321
self .assertIn ('cast' , a )
4323
4322
self .assertIn ('overload' , a )
4324
- if hasattr (contextlib , 'AbstractContextManager' ):
4325
- self .assertIn ('ContextManager' , a )
4323
+ # Context managers.
4324
+ self .assertIn ('ContextManager' , a )
4325
+ self .assertIn ('AsyncContextManager' , a )
4326
4326
# Check that io and re are not exported.
4327
4327
self .assertNotIn ('io' , a )
4328
4328
self .assertNotIn ('re' , a )
@@ -4336,8 +4336,6 @@ def test_all(self):
4336
4336
self .assertIn ('SupportsComplex' , a )
4337
4337
4338
4338
def test_all_exported_names (self ):
4339
- import typing
4340
-
4341
4339
actual_all = set (typing .__all__ )
4342
4340
computed_all = {
4343
4341
k for k , v in vars (typing ).items ()
0 commit comments