diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-12-10 11:05:45 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-12-10 11:05:45 (GMT) |
commit | 99d28ce0cdd96bc421f57424b078ef296bf7dbcb (patch) | |
tree | 9c91684c4b51e8d0d2b597c3eb884a02a877b139 /Lib | |
parent | 8ade268c6b38407778fc89ab442435cdc715d300 (diff) | |
parent | f29b4937f725681ad1b747ccd629ad022eb8c02e (diff) | |
download | cpython-99d28ce0cdd96bc421f57424b078ef296bf7dbcb.zip cpython-99d28ce0cdd96bc421f57424b078ef296bf7dbcb.tar.gz cpython-99d28ce0cdd96bc421f57424b078ef296bf7dbcb.tar.bz2 |
#15872: Be flexible with appending *.* in shutil.rmtree test case
The Windows buildbots seem to be unable to agree whether they need them or not.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_shutil.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index ad66631..a8951d3 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -172,7 +172,11 @@ class TestShutil(unittest.TestCase): filename = os.path.join(tmpdir, "tstfile") with self.assertRaises(NotADirectoryError) as cm: shutil.rmtree(filename) - self.assertEqual(cm.exception.filename, filename) + if cm.exception.filename.endswith('*.*'): + rm_name = os.path.join(filename, '*.*') + else: + rm_name = filename + self.assertEqual(cm.exception.filename, rm_name) self.assertTrue(os.path.exists(filename)) # test that ignore_errors option is honored shutil.rmtree(filename, ignore_errors=True) @@ -185,11 +189,11 @@ class TestShutil(unittest.TestCase): self.assertIs(errors[0][0], os.listdir) self.assertEqual(errors[0][1], filename) self.assertIsInstance(errors[0][2][1], NotADirectoryError) - self.assertEqual(errors[0][2][1].filename, filename) + self.assertEqual(errors[0][2][1].filename, rm_name) self.assertIs(errors[1][0], os.rmdir) self.assertEqual(errors[1][1], filename) self.assertIsInstance(errors[1][2][1], NotADirectoryError) - self.assertEqual(errors[1][2][1].filename, filename) + self.assertEqual(errors[1][2][1].filename, rm_name) # See bug #1071513 for why we don't run this on cygwin # and bug #1076467 for why we don't run this as root. |