summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-10-05 15:37:59 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-10-05 15:37:59 (GMT)
commitbed04a77ee4dde8e1ab7b00557519f01cac734aa (patch)
tree4178c3087d2bf3960cff12d2bbc722e521602896 /Lib/test/test_posix.py
parent047b7ae56628717160eb75e379e2bfdaa59dfc18 (diff)
downloadcpython-bed04a77ee4dde8e1ab7b00557519f01cac734aa.zip
cpython-bed04a77ee4dde8e1ab7b00557519f01cac734aa.tar.gz
cpython-bed04a77ee4dde8e1ab7b00557519f01cac734aa.tar.bz2
cleanup test_posix
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index a269db4..72fdd16 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -1127,16 +1127,17 @@ class PosixTester(unittest.TestCase):
"""
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):