mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
#15872: Fix shutil.rmtree error tests for Windows
This commit is contained in:
commit
b57b094077
1 changed files with 5 additions and 1 deletions
|
@ -171,7 +171,11 @@ class TestShutil(unittest.TestCase):
|
||||||
filename = os.path.join(tmpdir, "tstfile")
|
filename = os.path.join(tmpdir, "tstfile")
|
||||||
with self.assertRaises(NotADirectoryError) as cm:
|
with self.assertRaises(NotADirectoryError) as cm:
|
||||||
shutil.rmtree(filename)
|
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))
|
self.assertTrue(os.path.exists(filename))
|
||||||
# test that ignore_errors option is honored
|
# test that ignore_errors option is honored
|
||||||
shutil.rmtree(filename, ignore_errors=True)
|
shutil.rmtree(filename, ignore_errors=True)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue