diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-10-05 15:38:45 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-10-05 15:38:45 (GMT) |
commit | d577cea8ab0d929c40de93947dd68b9709607b35 (patch) | |
tree | 6c3075232ff9b70ecd47a10e954f7d6403485b2a /Lib/test/test_posix.py | |
parent | f4e4b83824318c2415e1d90d00726d07ba8790b9 (diff) | |
parent | bed04a77ee4dde8e1ab7b00557519f01cac734aa (diff) | |
download | cpython-d577cea8ab0d929c40de93947dd68b9709607b35.zip cpython-d577cea8ab0d929c40de93947dd68b9709607b35.tar.gz cpython-d577cea8ab0d929c40de93947dd68b9709607b35.tar.bz2 |
Merge 3.4
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r-- | Lib/test/test_posix.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index d9acfa4..f37f2de 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -1124,18 +1124,19 @@ class PosixTester(unittest.TestCase): """ Test functions that call path_error2(), providing two filenames in their exceptions. """ - for name in ("rename", "replace", "link", "symlink"): + for name in ("rename", "replace", "link"): function = getattr(os, name, None) + if function is None: + continue - if function: - for dst in ("noodly2", support.TESTFN): - try: - function('doesnotexistfilename', dst) - except OSError as e: - self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e)) - break - else: - self.fail("No valid path_error2() test for os." + name) + for dst in ("noodly2", support.TESTFN): + try: + function('doesnotexistfilename', dst) + except OSError as e: + self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e)) + break + else: + self.fail("No valid path_error2() test for os." + name) class PosixGroupsTester(unittest.TestCase): |