Skip to content

Commit 4136847

Browse files
gh-81793: Skip tests for os.link(follow_links=) on Android
1 parent c8f233c commit 4136847

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_posix.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,6 +1549,10 @@ def test_link_follow_symlinks(self):
15491549
except NotImplementedError:
15501550
if os.link in os.supports_follow_symlinks or default_no_follow:
15511551
raise
1552+
except PermissionError:
1553+
if sys.platform == 'android':
1554+
self.skipTest('Android blocks follow_symlinks with SELinux')
1555+
raise
15521556
else:
15531557
self.addCleanup(os_helper.unlink, link)
15541558
self.assertEqual(posix.lstat(link), posix.lstat(symlink))
@@ -1561,6 +1565,10 @@ def test_link_follow_symlinks(self):
15611565
except NotImplementedError:
15621566
if os.link in os.supports_follow_symlinks or default_follow:
15631567
raise
1568+
except PermissionError:
1569+
if sys.platform == 'android':
1570+
self.skipTest('Android blocks follow_symlinks with SELinux')
1571+
raise
15641572
else:
15651573
self.addCleanup(os_helper.unlink, link)
15661574
self.assertEqual(posix.lstat(link), posix.lstat(orig))

0 commit comments

Comments
 (0)