diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-12-10 09:07:11 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-12-10 09:07:11 (GMT) |
commit | 9e8ac56e35c04a5326af6683f9dc491dee67f8fe (patch) | |
tree | 80e0cf4ca58a956d6fe6325ba0914962d4f8c7ca | |
parent | d16eacba48bc625708277a2e78350576ff16c225 (diff) | |
download | cpython-9e8ac56e35c04a5326af6683f9dc491dee67f8fe.zip cpython-9e8ac56e35c04a5326af6683f9dc491dee67f8fe.tar.gz cpython-9e8ac56e35c04a5326af6683f9dc491dee67f8fe.tar.bz2 |
#15872: Fix shutil.rmtree error tests for Windows
-rw-r--r-- | Lib/test/test_shutil.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index da42604..9dab5f5 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -132,7 +132,11 @@ class TestShutil(unittest.TestCase): filename = os.path.join(tmpdir, "tstfile") with self.assertRaises(OSError) as cm: shutil.rmtree(filename) - self.assertEqual(cm.exception.filename, filename) + if os.name == 'nt': + 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 honoured shutil.rmtree(filename, ignore_errors=True) |