mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
cleanup test_posix
This commit is contained in:
parent
047b7ae566
commit
bed04a77ee
1 changed files with 10 additions and 9 deletions
|
@ -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):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue