summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shutil.py
diff options
context:
space:
mode:
authorJohannes Gijsbers <jlg@dds.nl>2004-12-06 20:50:15 (GMT)
committerJohannes Gijsbers <jlg@dds.nl>2004-12-06 20:50:15 (GMT)
commitb8b09d05130aeba86ae41d3bee8fa3c6e7395339 (patch)
treea91d4aff72a4c6912f92600b05823903bdbe247e /Lib/test/test_shutil.py
parenta32d22a509c852987827b30d05371b38eb1ff87f (diff)
downloadcpython-b8b09d05130aeba86ae41d3bee8fa3c6e7395339.zip
cpython-b8b09d05130aeba86ae41d3bee8fa3c6e7395339.tar.gz
cpython-b8b09d05130aeba86ae41d3bee8fa3c6e7395339.tar.bz2
SF bug #1076467: don't run test_on_error as root, as the permission
errors don't get provoked that way. Also add a bunch of cross-references to bugs.
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r--Lib/test/test_shutil.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py
index 1db3fc5..c28e5a3 100644
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -16,7 +16,10 @@ class TestShutil(unittest.TestCase):
filename = tempfile.mktemp()
self.assertRaises(OSError, shutil.rmtree, filename)
- if hasattr(os, 'chmod') and sys.platform[:6] != 'cygwin':
+ # See bug #1071513 for why we don't run this on cygwin
+ # and bug #1076467 for why we don't run this as root.
+ 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)
@@ -31,7 +34,8 @@ class TestShutil(unittest.TestCase):
shutil.rmtree(TESTFN, onerror=self.check_args_to_onerror)
# Test whether onerror has actually been called.
- self.assertEqual(self.errorState, 2)
+ self.assertEqual(self.errorState, 2,
+ "Expected call to onerror function did not happen.")
# Make writable again.
os.chmod(TESTFN, old_dir_mode)