From: Antoine Pitrou Date: Mon, 2 Jan 2012 18:18:02 +0000 (+0100) Subject: Mock the rename failure a bit better X-Git-Tag: v3.3.0a1~488 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c041ab6c7d8fb6c32499c7adbe36bb9b48228c2c;p=thirdparty%2FPython%2Fcpython.git Mock the rename failure a bit better --- diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index a2002369aa29..a750166fac29 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -7,6 +7,7 @@ import sys import stat import os import os.path +import errno import functools from test import support from test.support import TESTFN @@ -46,7 +47,7 @@ except ImportError: 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)