mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +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"):
|
for name in ("rename", "replace", "link"):
|
||||||
function = getattr(os, name, None)
|
function = getattr(os, name, None)
|
||||||
|
if function is None:
|
||||||
|
continue
|
||||||
|
|
||||||
if function:
|
for dst in ("noodly2", support.TESTFN):
|
||||||
for dst in ("noodly2", support.TESTFN):
|
try:
|
||||||
try:
|
function('doesnotexistfilename', dst)
|
||||||
function('doesnotexistfilename', dst)
|
except OSError as e:
|
||||||
except OSError as e:
|
self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e))
|
||||||
self.assertIn("'doesnotexistfilename' -> '{}'".format(dst), str(e))
|
break
|
||||||
break
|
else:
|
||||||
else:
|
self.fail("No valid path_error2() test for os." + name)
|
||||||
self.fail("No valid path_error2() test for os." + name)
|
|
||||||
|
|
||||||
class PosixGroupsTester(unittest.TestCase):
|
class PosixGroupsTester(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue