Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
bpo-38671: Add test that pathlib.Path.resolve() returns an absolute…
… path.

Authored by Tzu-ping Chung (uranusjr)
  • Loading branch information
barneygale committed May 17, 2021
commit 790721d93ad6ff7304c23bfc94779f5c660a844d
10 changes: 10 additions & 0 deletions Lib/test/test_pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,16 @@ def test_resolve_dot(self):
# 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()
Expand Down