mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
[3.10] bpo-38671: Add test that pathlib.Path.resolve()
returns an absolute path. (GH-26184) (GH-26270)
Issue should be fixed in [bpo-43757]()
Co-Authored-by: Tzu-ping Chung <uranusjr@gmail.com>
(cherry picked from commit 18f41c04ff
)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Automerge-Triggered-By: GH:encukou
This commit is contained in:
parent
36843f716d
commit
ee51c56c02
1 changed files with 10 additions and 0 deletions
|
@ -1799,6 +1799,16 @@ class _BasePathTest(object):
|
|||
# Non-strict
|
||||
self.assertEqual(r.resolve(strict=False), p / '3' / '4')
|
||||
|
||||
def test_resolve_nonexist_relative_issue38671(self):
|
||||
p = self.cls('non', 'exist')
|
||||
|
||||
old_cwd = os.getcwd()
|
||||
os.chdir(BASE)
|
||||
try:
|
||||
self.assertEqual(p.resolve(), self.cls(BASE, p))
|
||||
finally:
|
||||
os.chdir(old_cwd)
|
||||
|
||||
def test_with(self):
|
||||
p = self.cls(BASE)
|
||||
it = p.iterdir()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue