@@ -556,13 +556,6 @@ def testZipImporterMethods(self):
556556 self .assertEqual (zi .archive , TEMP_ZIP )
557557 self .assertTrue (zi .is_package (TESTPACK ))
558558
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-
566559 # PEP 451
567560 spec = zi .find_spec ('spam' )
568561 self .assertIsNotNone (spec )
@@ -675,11 +668,6 @@ def testZipImporterMethodsInSubDirectory(self):
675668 self .assertEqual (zi .archive , TEMP_ZIP )
676669 self .assertEqual (zi .prefix , packdir )
677670 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__ )
683671 # PEP 451
684672 spec = zi .find_spec (TESTPACK2 )
685673 mod = importlib .util .module_from_spec (spec )
@@ -1069,9 +1057,6 @@ def _testBogusZipFile(self):
10691057 z = zipimport .zipimporter (TESTMOD )
10701058
10711059 try :
1072- with warnings .catch_warnings ():
1073- warnings .simplefilter ("ignore" , DeprecationWarning )
1074- self .assertRaises (TypeError , z .load_module , None )
10751060 self .assertRaises (TypeError , z .find_module , None )
10761061 self .assertRaises (TypeError , z .find_spec , None )
10771062 self .assertRaises (TypeError , z .exec_module , None )
@@ -1082,10 +1067,6 @@ def _testBogusZipFile(self):
10821067
10831068 error = zipimport .ZipImportError
10841069 self .assertIsNone (z .find_spec ('abc' ))
1085-
1086- with warnings .catch_warnings ():
1087- warnings .simplefilter ("ignore" , DeprecationWarning )
1088- self .assertRaises (error , z .load_module , 'abc' )
10891070 self .assertRaises (error , z .get_code , 'abc' )
10901071 self .assertRaises (OSError , z .get_data , 'abc' )
10911072 self .assertRaises (error , z .get_source , 'abc' )
0 commit comments