mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
os.path. Thanks to Jelle Zijlstra for the initial patch against posixmodule.c.
This commit is contained in:
parent
6ed442c48d
commit
3f9183b5ac
11 changed files with 424 additions and 52 deletions
|
@ -397,7 +397,7 @@ class PosixTester(unittest.TestCase):
|
|||
self.assertTrue(posix.stat(fp.fileno()))
|
||||
|
||||
self.assertRaisesRegex(TypeError,
|
||||
'should be string, bytes or integer, not',
|
||||
'should be string, bytes, os.PathLike or integer, not',
|
||||
posix.stat, float(fp.fileno()))
|
||||
finally:
|
||||
fp.close()
|
||||
|
@ -409,16 +409,16 @@ class PosixTester(unittest.TestCase):
|
|||
self.assertTrue(posix.stat(os.fsencode(support.TESTFN)))
|
||||
|
||||
self.assertWarnsRegex(DeprecationWarning,
|
||||
'should be string, bytes or integer, not',
|
||||
'should be string, bytes, os.PathLike or integer, not',
|
||||
posix.stat, bytearray(os.fsencode(support.TESTFN)))
|
||||
self.assertRaisesRegex(TypeError,
|
||||
'should be string, bytes or integer, not',
|
||||
'should be string, bytes, os.PathLike or integer, not',
|
||||
posix.stat, None)
|
||||
self.assertRaisesRegex(TypeError,
|
||||
'should be string, bytes or integer, not',
|
||||
'should be string, bytes, os.PathLike or integer, not',
|
||||
posix.stat, list(support.TESTFN))
|
||||
self.assertRaisesRegex(TypeError,
|
||||
'should be string, bytes or integer, not',
|
||||
'should be string, bytes, os.PathLike or integer, not',
|
||||
posix.stat, list(os.fsencode(support.TESTFN)))
|
||||
|
||||
@unittest.skipUnless(hasattr(posix, 'mkfifo'), "don't have mkfifo()")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue