From: Hynek Schlawack <hs@ox.cx> Date: Mon, 10 Dec 2012 09:07:11 +0000 (+0100) Subject: #15872: Fix shutil.rmtree error tests for Windows X-Git-Tag: v3.3.1rc1~544^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e8ac56e35c04a5326af6683f9dc491dee67f8fe;p=python #15872: Fix shutil.rmtree error tests for Windows --- diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index da42604922..9dab5f510d 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)