diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-12-10 09:08:41 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-12-10 09:08:41 (GMT) |
commit | b57b09407767d340c655cb12acd4cc0a561cab0f (patch) | |
tree | 0d5c98c69d9864c9a1ef8971fa39fb74e41f3941 /Lib/test/test_shutil.py | |
parent | b550110f6485913bf4f5037df11c88158e788993 (diff) | |
parent | 9e8ac56e35c04a5326af6683f9dc491dee67f8fe (diff) | |
download | cpython-b57b09407767d340c655cb12acd4cc0a561cab0f.zip cpython-b57b09407767d340c655cb12acd4cc0a561cab0f.tar.gz cpython-b57b09407767d340c655cb12acd4cc0a561cab0f.tar.bz2 |
#15872: Fix shutil.rmtree error tests for Windows
Diffstat (limited to 'Lib/test/test_shutil.py')
-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 149e4c3..f352ef1 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -171,7 +171,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 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 honored shutil.rmtree(filename, ignore_errors=True) |