8000 Fix test_ntpath (pass 2) · python/cpython@72147c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 72147c5

Browse files
committed
Fix test_ntpath (pass 2)
1 parent 7362f7e commit 72147c5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Lib/test/test_ntpath.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,16 +415,15 @@ def test_realpath_symlink_loops_strict(self):
415415
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "1", strict=True)
416416
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "2", strict=True)
417417
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "1\\x", strict=True)
418-
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "1\\..\\x", strict=True)
419418
# Windows eliminates '..' components before resolving links, so the
420-
# following 2 realpath() calls are not expected to raise.
419+
# following call is not expected to raise.
421420
self.assertPathEqual(ntpath.realpath(ABSTFN + "1\\..", strict=True),
422421
ntpath.dirname(ABSTFN))
422+
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "1\\..\\x", strict=True)
423423
os.symlink(ABSTFN + "x", ABSTFN + "y")
424-
self.assertPathEqual(ntpath.realpath(ABSTFN + "1\\..\\"
424+
self.assertRaises(OSError, ntpath.realpath, ABSTFN + "1\\..\\"
425425
+ ntpath.basename(ABSTFN) + "y",
426-
strict=True),
427-
ABSTFN + "x")
426+
strict=True)
428427
self.assertRaises(OSError, ntpath.realpath,
429428
ABSTFN + "1\\..\\" + ntpath.basename(ABSTFN) + "1",
430429
strict=True)

0 commit comments

Comments
 (0)
0