@@ -208,8 +208,7 @@ def test_rmtree_fails_on_symlink_onerror(self):
208208 errors = []
209209 def onerror (* args ):
210210 errors .append (args )
211- with self .assertWarns (DeprecationWarning ):
212- shutil .rmtree (link , onerror = onerror )
211+ shutil .rmtree (link , onerror = onerror )
213212 self .assertEqual (len (errors ), 1 )
214213 self .assertIs (errors [0 ][0 ], os .path .islink )
215214 self .assertEqual (errors [0 ][1 ], link )
@@ -270,8 +269,7 @@ def test_rmtree_fails_on_junctions_onerror(self):
270269 errors = []
271270 def onerror (* args ):
272271 errors .append (args )
273- with self .assertWarns (DeprecationWarning ):
274- shutil .rmtree (link , onerror = onerror )
272+ shutil .rmtree (link , onerror = onerror )
275273 self .assertEqual (len (errors ), 1 )
276274 self .assertIs (errors [0 ][0 ], os .path .islink )
277275 self .assertEqual (errors [0 ][1 ], link )
@@ -340,8 +338,7 @@ def test_rmtree_errors_onerror(self):
340338 errors = []
341339 def onerror (* args ):
342340 errors .append (args )
343- with self .assertWarns (DeprecationWarning ):
344- shutil .rmtree (filename , onerror = onerror )
341+ shutil .rmtree (filename , onerror = onerror )
345342 self .assertEqual (len (errors ), 2 )
346343 self .assertIs (errors [0 ][0 ], os .scandir )
347344 self .assertEqual (errors [0 ][1 ], filename )
@@ -410,8 +407,7 @@ def test_on_error(self):
410407 self .addCleanup (os .chmod , self .child_file_path , old_child_file_mode )
411408 self .addCleanup (os .chmod , self .child_dir_path , old_child_dir_mode )
412409
413- with self .assertWarns (DeprecationWarning ):
414- shutil .rmtree (TESTFN , onerror = self .check_args_to_onerror )
410+ shutil .rmtree (TESTFN , onerror = self .check_args_to_onerror )
415411 # Test whether onerror has actually been called.
416412 self .assertEqual (self .errorState , 3 ,
417413 "Expected call to onerror function did not happen." )
@@ -537,8 +533,7 @@ def onexc(*args):
537533 self .addCleanup (os .chmod , self .child_file_path , old_child_file_mode )
538534 self .addCleanup (os .chmod , self .child_dir_path , old_child_dir_mode )
539535
540- with self .assertWarns (DeprecationWarning ):
541- shutil .rmtree (TESTFN , onerror = onerror , onexc = onexc )
536+ shutil .rmtree (TESTFN , onerror = onerror , onexc = onexc )
542537 self .assertTrue (onexc_called )
543538 self .assertFalse (onerror_called )
544539
0 commit comments