10000 [3.10] bpo-38671: Add test that `pathlib.Path.resolve()` returns an absolute path. (GH-26184) by barneygale · Pull Request #26270 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.10] bpo-38671: Add test that pathlib.Path.resolve() returns an absolute path. (GH-26184) #26270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2021
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
[3.10] bpo-38671: Add test that pathlib.Path.resolve() returns an a…
…bsolute path. (GH-26184)

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>
  • Loading branch information
barneygale committed May 20, 2021
commit 286315665bd907f9c517ec9ffe8bcc20fd2027fa
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
0