diff options
author | xdegaye <xdegaye@gmail.com> | 2017-11-12 16:31:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-12 16:31:07 (GMT) |
commit | 92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb (patch) | |
tree | e2f19b5353b11b39f9f375aaa5e785156b033ada /Lib/test/test_genericpath.py | |
parent | e0582a37c8d1776a2fd4968e9216f3a05f780276 (diff) | |
download | cpython-92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb.zip cpython-92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb.tar.gz cpython-92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb.tar.bz2 |
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.
Diffstat (limited to 'Lib/test/test_genericpath.py')
-rw-r--r-- | Lib/test/test_genericpath.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index f698e13..01e11da 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -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 |