mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-28759: Skip some tests on PermissionError raised by Android (GH-4350)
Access to mkfifo(), mknod() and hard link creation is controled by SELinux on Android. Also remove test.support.android_not_root.
This commit is contained in:
parent
e0582a37c8
commit
92c2ca7633
7 changed files with 50 additions and 34 deletions
|
@ -8,7 +8,6 @@ import sys
|
|||
import unittest
|
||||
import warnings
|
||||
from test import support
|
||||
android_not_root = support.android_not_root
|
||||
|
||||
|
||||
def create_file(filename, data=b'foo'):
|
||||
|
@ -213,9 +212,11 @@ class GenericTest:
|
|||
def test_samefile_on_symlink(self):
|
||||
self._test_samefile_on_link_func(os.symlink)
|
||||
|
||||
@unittest.skipIf(android_not_root, "hard links not allowed, non root user")
|
||||
def test_samefile_on_link(self):
|
||||
self._test_samefile_on_link_func(os.link)
|
||||
try:
|
||||
self._test_samefile_on_link_func(os.link)
|
||||
except PermissionError as e:
|
||||
self.skipTest('os.link(): %s' % e)
|
||||
|
||||
def test_samestat(self):
|
||||
test_fn1 = support.TESTFN
|
||||
|
@ -253,9 +254,11 @@ class GenericTest:
|
|||
def test_samestat_on_symlink(self):
|
||||
self._test_samestat_on_link_func(os.symlink)
|
||||
|
||||
@unittest.skipIf(android_not_root, "hard links not allowed, non root user")
|
||||
def test_samestat_on_link(self):
|
||||
self._test_samestat_on_link_func(os.link)
|
||||
try:
|
||||
self._test_samestat_on_link_func(os.link)
|
||||
except PermissionError as e:
|
||||
self.skipTest('os.link(): %s' % e)
|
||||
|
||||
def test_sameopenfile(self):
|
||||
filename = support.TESTFN
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue