@@ -224,15 +224,7 @@ class ResourceLoaderDefaultsTests(ABCTestHarness):
224224 SPLIT = make_abc_subclasses (ResourceLoader )
225225
226226 def test_get_data (self ):
227- with (
228- self .assertRaises (IOError ),
229- self .assertWarnsRegex (
230- DeprecationWarning ,
231- r"importlib\.abc\.ResourceLoader is deprecated in favour of "
232- r"supporting resource loading through importlib\.resources"
233- r"\.abc\.TraversableResources." ,
234- ),
235- ):
227+ with self .assertRaises (IOError ):
236228 self .ins .get_data ('/some/path' )
237229
238230
@@ -936,13 +928,8 @@ def get_filename(self, fullname):
936928
937929 def path_stats (self , path ):
938930 return {'mtime' : 1 }
939- with self .assertWarnsRegex (
940- DeprecationWarning ,
941- r"importlib\.abc\.ResourceLoader is deprecated in favour of "
942- r"supporting resource loading through importlib\.resources"
943- r"\.abc\.TraversableResources." ,
944- ):
945- loader = DummySourceLoader ()
931+
932+ loader = DummySourceLoader ()
946933
947934 with self .assertWarnsRegex (
948935 DeprecationWarning ,
@@ -952,17 +939,5 @@ def path_stats(self, path):
952939 loader .path_mtime ('foo.py' )
953940
954941
955- class ResourceLoaderDeprecationWarningsTests (unittest .TestCase ):
956- """Tests ResourceLoader deprecation warnings."""
957-
958- def test_deprecated_resource_loader (self ):
959- from importlib .abc import ResourceLoader
960- class DummyLoader (ResourceLoader ):
961- def get_data (self , path ):
962- return b''
963-
964- with self .assertWarns (DeprecationWarning ):
965- DummyLoader ()
966-
967942if __name__ == '__main__' :
968943 unittest .main ()
0 commit comments