]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport of fix for SF bug #1076467: don't run test_on_error as root, as
authorJohannes Gijsbers <jlg@dds.nl>
Mon, 6 Dec 2004 21:22:17 +0000 (21:22 +0000)
committerJohannes Gijsbers <jlg@dds.nl>
Mon, 6 Dec 2004 21:22:17 +0000 (21:22 +0000)
the permission errors don't get provoked that way.

Lib/test/test_shutil.py

index 1db3fc527e4ed2bb07117765e304a57939c559e9..0f78ddc5c0dfb133528e9c75425486fb0c7d6244 100644 (file)
@@ -16,7 +16,8 @@ class TestShutil(unittest.TestCase):
         filename = tempfile.mktemp()
         self.assertRaises(OSError, shutil.rmtree, filename)
 
-    if hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin':
+    if (hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin'
+        and os.getenv('USER') != 'root'):
         def test_on_error(self):
             self.errorState = 0
             os.mkdir(TESTFN)