[Python-checkins] cpython (merge 3.2 -> 3.3): #15872: Fix shutil.rmtree error tests for Windows

hynek.schlawack python-checkins at python.org
Mon Dec 10 10:11:31 CET 2012


http://hg.python.org/cpython/rev/4b2fca8ad07b
changeset:   80803:4b2fca8ad07b
branch:      3.3
parent:      80800:fc394216c724
parent:      80802:5211391928bc
user:        Hynek Schlawack <hs at ox.cx>
date:        Mon Dec 10 10:08:41 2012 +0100
summary:
  #15872: Fix shutil.rmtree error tests for Windows

files:
  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
--- a/Lib/test/test_shutil.py
+++ b/Lib/test/test_shutil.py
@@ -171,7 +171,11 @@
         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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list