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

Skip to content

Commit 18f41c0

Browse files
barneygaleuranusjr
andauthored
bpo-38671: Add test that pathlib.Path.resolve() returns an absolute path. (GH-26184)
Issue should be fixed in bpo-43757 Co-Authored-by: Tzu-ping Chung <uranusjr@gmail.com>
1 parent 7109624 commit 18f41c0

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