File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,10 @@ def test_rmtree_errors(self):
1616 filename = tempfile .mktemp ()
1717 self .assertRaises (OSError , shutil .rmtree , filename )
1818
19- if hasattr (os , 'chmod' ) and sys .platform [:6 ] != 'cygwin' :
19+ # See bug #1071513 for why we don't run this on cygwin
20+ # and bug #1076467 for why we don't run this as root.
21+ if (hasattr (os , 'chmod' ) and sys .platform [:6 ] != 'cygwin'
22+ and os .getenv ('USER' ) != 'root' ):
2023 def test_on_error (self ):
2124 self .errorState = 0
2225 os .mkdir (TESTFN )
@@ -31,7 +34,8 @@ def test_on_error(self):
3134
3235 shutil .rmtree (TESTFN , onerror = self .check_args_to_onerror )
3336 # Test whether onerror has actually been called.
34- self .assertEqual (self .errorState , 2 )
37+ self .assertEqual (self .errorState , 2 ,
38+ "Expected call to onerror function did not happen." )
3539
3640 # Make writable again.
3741 os .chmod (TESTFN , old_dir_mode )
You can’t perform that action at this time.
0 commit comments