@@ -209,8 +209,7 @@ def test_rmtree_fails_on_symlink_onerror(self):
209209 errors = []
210210 def onerror (* args ):
211211 errors .append (args )
212- with self .assertWarns (DeprecationWarning ):
213- shutil .rmtree (link , onerror = onerror )
212+ shutil .rmtree (link , onerror = onerror )
214213 self .assertEqual (len (errors ), 1 )
215214 self .assertIs (errors [0 ][0 ], os .path .islink )
216215 self .assertEqual (errors [0 ][1 ], link )
@@ -271,8 +270,7 @@ def test_rmtree_fails_on_junctions_onerror(self):
271270 errors = []
272271 def onerror (* args ):
273272 errors .append (args )
274- with self .assertWarns (DeprecationWarning ):
275- shutil .rmtree (link , onerror = onerror )
273+ shutil .rmtree (link , onerror = onerror )
276274 self .assertEqual (len (errors ), 1 )
277275 self .assertIs (errors [0 ][0 ], os .path .islink )
278276 self .assertEqual (errors [0 ][1 ], link )
@@ -341,8 +339,7 @@ def test_rmtree_errors_onerror(self):
341339 errors = []
342340 def onerror (* args ):
343341 errors .append (args )
344- with self .assertWarns (DeprecationWarning ):
345- shutil .rmtree (filename , onerror = onerror )
342+ shutil .rmtree (filename , onerror = onerror )
346343 self .assertEqual (len (errors ), 2 )
347344 self .assertIs (errors [0 ][0 ], os .scandir )
348345 self .assertEqual (errors [0 ][1 ], filename )
@@ -411,8 +408,7 @@ def test_on_error(self):
411408 self .addCleanup (os .chmod , self .child_file_path , old_child_file_mode )
412409 self .addCleanup (os .chmod , self .child_dir_path , old_child_dir_mode )
413410
414- with self .assertWarns (DeprecationWarning ):
415- shutil .rmtree (TESTFN , onerror = self .check_args_to_onerror )
411+ shutil .rmtree (TESTFN , onerror = self .check_args_to_onerror )
416412 # Test whether onerror has actually been called.
417413 self .assertEqual (self .errorState , 3 ,
418414 "Expected call to onerror function did not happen." )
@@ -538,8 +534,7 @@ def onexc(*args):
538534 self .addCleanup (os .chmod , self .child_file_path , old_child_file_mode )
539535 self .addCleanup (os .chmod , self .child_dir_path , old_child_dir_mode )
540536
541- with self .assertWarns (DeprecationWarning ):
542- shutil .rmtree (TESTFN , onerror = onerror , onexc = onexc )
537+ shutil .rmtree (TESTFN , onerror = onerror , onexc = onexc )
543538 self .assertTrue (onexc_called )
544539 self .assertFalse (onerror_called )
545540
0 commit comments