@@ -556,13 +556,6 @@ def testZipImporterMethods(self):
556
556
self .assertEqual (zi .archive , TEMP_ZIP )
557
557
self .assertTrue (zi .is_package (TESTPACK ))
558
558
559
- # PEP 302
560
- with warnings .catch_warnings ():
561
- warnings .simplefilter ("ignore" , DeprecationWarning )
562
-
563
- mod = zi .load_module (TESTPACK )
564
- self .assertEqual (zi .get_filename (TESTPACK ), mod .__file__ )
565
-
566
559
# PEP 451
567
560
spec = zi .find_spec ('spam' )
568
561
self .assertIsNotNone (spec )
@@ -675,11 +668,6 @@ def testZipImporterMethodsInSubDirectory(self):
675
668
self .assertEqual (zi .archive , TEMP_ZIP )
676
669
self .assertEqual (zi .prefix , packdir )
677
670
self .assertTrue (zi .is_package (TESTPACK2 ))
678
- # PEP 302
679
- with warnings .catch_warnings ():
680
- warnings .simplefilter ("ignore" , DeprecationWarning )
681
- mod = zi .load_module (TESTPACK2 )
682
- self .assertEqual (zi .get_filename (TESTPACK2 ), mod .__file__ )
683
671
# PEP 451
684
672
spec = zi .find_spec (TESTPACK2 )
685
673
mod = importlib .util .module_from_spec (spec )
@@ -1069,9 +1057,6 @@ def _testBogusZipFile(self):
1069
1057
z = zipimport .zipimporter (TESTMOD )
1070
1058
1071
1059
try :
1072
- with warnings .catch_warnings ():
1073
- warnings .simplefilter ("ignore" , DeprecationWarning )
1074
- self .assertRaises (TypeError , z .load_module , None )
1075
1060
self .assertRaises (TypeError , z .find_module , None )
1076
1061
self .assertRaises (TypeError , z .find_spec , None )
1077
1062
self .assertRaises (TypeError , z .exec_module , None )
@@ -1083,9 +1068,6 @@ def _testBogusZipFile(self):
1083
1068
error = zipimport .ZipImportError
1084
1069
self .assertIsNone (z .find_spec ('abc' ))
1085
1070
1086
- with warnings .catch_warnings ():
1087
- warnings .simplefilter ("ignore" , DeprecationWarning )
1088
- self .assertRaises (error , z .load_module , 'abc' )
1089
1071
self .assertRaises (error , z .get_code , 'abc' )
1090
1072
self .assertRaises (OSError , z .get_data , 'abc' )
1091
1073
self .assertRaises (error , z .get_source , 'abc' )
0 commit comments