Kaydet (Commit) 8e5a8296 authored tarafından Hynek Schlawack's avatar Hynek Schlawack

#15872: Fix shutil.rmtree error tests for Windows

......@@ -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 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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment