mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Issue #27186: Update os.fspath()/PyOS_FSPath() to check the return
type of __fspath__(). As part of this change, also make sure that the pure Python implementation of os.fspath() is tested.
This commit is contained in:
parent
19b2a53a82
commit
c78ca1e044
7 changed files with 101 additions and 71 deletions
|
@ -879,7 +879,7 @@ class IOTest(unittest.TestCase):
|
|||
check_path_succeeds(PathLike(support.TESTFN.encode('utf-8')))
|
||||
|
||||
bad_path = PathLike(TypeError)
|
||||
with self.assertRaisesRegex(TypeError, 'invalid file'):
|
||||
with self.assertRaises(TypeError):
|
||||
self.open(bad_path, 'w')
|
||||
|
||||
# ensure that refcounting is correct with some error conditions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue