Kaydet (Commit) bed04a77 authored tarafından Victor Stinner's avatar Victor Stinner

cleanup test_posix

üst 047b7ae5
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment