File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -226,7 +226,15 @@ class ResourceLoaderDefaultsTests(ABCTestHarness):
226226    SPLIT  =  make_abc_subclasses (ResourceLoader )
227227
228228    def  test_get_data (self ):
229-         with  self .assertRaises (IOError ):
229+         with  (
230+             self .assertRaises (IOError ),
231+             self .assertWarnsRegex (
232+                 DeprecationWarning ,
233+                 r"importlib\.abc\.ResourceLoader is deprecated in favour of " 
234+                 r"supporting resource loading through importlib\.resources" 
235+                 r"\.abc\.TraversableResources." ,
236+             ),
237+         ):
230238            self .ins .get_data ('/some/path' )
231239
232240
@@ -927,9 +935,19 @@ def get_filename(self, fullname):
927935
928936            def  path_stats (self , path ):
929937                return  {'mtime' : 1 }
930- 
931-         loader  =  DummySourceLoader ()
932-         with  self .assertWarns (DeprecationWarning ):
938+         with  self .assertWarnsRegex (
939+             DeprecationWarning ,
940+             r"importlib\.abc\.ResourceLoader is deprecated in favour of " 
941+             r"supporting resource loading through importlib\.resources" 
942+             r"\.abc\.TraversableResources." ,
943+         ):
944+             loader  =  DummySourceLoader ()
945+ 
946+         with  self .assertWarnsRegex (
947+             DeprecationWarning ,
948+             r"SourceLoader\.path_mtime is deprecated in favour of " 
949+             r"SourceLoader\.path_stats\(\)\." 
950+         ):
933951            loader .path_mtime ('foo.py' )
934952
935953
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments