File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -937,9 +937,13 @@ class ResourceLoaderDeprecationWarningsTests(unittest.TestCase):
937937 """Tests ResourceLoader deprecation warnings."""
938938
939939 def test_deprecated_resource_loader (self ):
940- with self .assertWarns (DeprecationWarning ):
941- from importlib .abc import ResourceLoader
940+ from importlib .abc import ResourceLoader
941+ class DummyLoader (ResourceLoader ):
942+ def get_data (self , path ):
943+ return b''
942944
945+ with self .assertWarns (DeprecationWarning ):
946+ DummyLoader ()
943947
944948if __name__ == '__main__' :
945949 unittest .main ()
Original file line number Diff line number Diff line change @@ -493,18 +493,22 @@ def test_util(self):
493493
494494
495495class TestDeprecations (unittest .TestCase ):
496- def test_machinery_deprecated_members (self ):
496+ def test_machinery_deprecated_attributes (self ):
497497 from importlib import machinery
498498 attributes = (
499499 'DEBUG_BYTECODE_SUFFIXES' ,
500500 'OPTIMIZED_BYTECODE_SUFFIXES' ,
501- 'WindowsRegistryFinder' ,
502501 )
503502 for attr in attributes :
504503 with self .subTest (attr = attr ):
505504 with self .assertWarns (DeprecationWarning ):
506505 getattr (machinery , attr )
507506
507+ def test_deprecated_windows_registry_finder (self ):
508+ from importlib .machinery import WindowsRegistryFinder
509+ with self .assertWarns (DeprecationWarning ):
510+ WindowsRegistryFinder ()
511+
508512
509513if __name__ == '__main__' :
510514 unittest .main ()
You can’t perform that action at this time.
0 commit comments