Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Test non-exist resolve on all platforms
  • Loading branch information
uranusjr committed Apr 27, 2021
commit 7cff82ea1b9b44310343fa617596a1c6426dd553
20 changes: 10 additions & 10 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 Expand Up @@ -2654,16 +2664,6 @@ def check():
env['HOME'] = 'C:\\Users\\eve'
check()

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)


class CompatiblePathTest(unittest.TestCase):
"""
Expand Down