8000 [3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an a… · python/cpython@ee51c56 · GitHub
[go: up one dir, main page]

Skip to content

Commit ee51c56

Browse files
authored
[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 18f41c0) Co-authored-by: Barney Gale <barney.gale@gmail.com> Automerge-Triggered-By: GH:encukou
1 parent 36843f7 commit ee51c56

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_pathlib.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,16 @@ def test_resolve_dot(self):
17991799
# Non-strict
18001800
self.assertEqual(r.resolve(strict=False), p / '3' / '4')
18011801

1802+
def test_resolve_nonexist_relative_issue38671(self):
1803+
p = self.cls('non', 'exist')
1804+
1805+
old_cwd = os.getcwd()
1806+
os.chdir(BASE)
1807+
try:
1808+
self.assertEqual(p.resolve(), self.cls(BASE, p))
1809+
finally:
1810+
os.chdir(old_cwd)
1811+
18021812
def test_with(self):
18031813
p = self.cls(BASE)
18041814
it = p.iterdir()

0 commit comments

Comments
 (0)
0