[Python-checkins] cpython: Mock the rename failure a bit better

antoine.pitrou python-checkins at python.org
Mon Jan 2 19:20:56 CET 2012


http://hg.python.org/cpython/rev/3ed5a6030c9b
changeset:   74240:3ed5a6030c9b
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Mon Jan 02 19:18:02 2012 +0100
summary:
  Mock the rename failure a bit better

files:
  Lib/test/test_shutil.py |  3 ++-
  1 files changed, 2 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
@@ -7,6 +7,7 @@
 import stat
 import os
 import os.path
+import errno
 import functools
 from test import support
 from test.support import TESTFN
@@ -46,7 +47,7 @@
 
 def _fake_rename(*args, **kwargs):
     # Pretend the destination path is on a different filesystem.
-    raise OSError()
+    raise OSError(getattr(errno, 'EXDEV', 18), "Invalid cross-device link")
 
 def mock_rename(func):
     @functools.wraps(func)

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


More information about the Python-checkins mailing list