Skip to content

Commit 29c7b31

Browse files
committed
Skip PermissionError test for root
1 parent 5c92d7b commit 29c7b31

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_posixpath.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,13 @@ def test_realpath_unreadable_directory(self):
860860
self.assertEqual(realpath(ABSTFN, strict=True), ABSTFN)
861861
self.assertEqual(realpath(ABSTFN, strict=ALLOW_MISSING), ABSTFN)
862862

863+
try:
864+
os.stat(ABSTFN)
865+
except PermissionError:
866+
pass
867+
else:
868+
self.skipTest('Cannot block permissions')
869+
863870
self.assertEqual(realpath(ABSTFN + '/k', strict=False),
864871
ABSTFN + '/k')
865872
self.assertRaises(PermissionError, realpath, ABSTFN + '/k',

0 commit comments

Comments
 (0)