summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorxdegaye <xdegaye@gmail.com>2017-11-12 16:31:07 (GMT)
committerGitHub <noreply@github.com>2017-11-12 16:31:07 (GMT)
commit92c2ca7633c881a56157f2fb8b2e1b8c7114e5fb (patch)
treee2f19b5353b11b39f9f375aaa5e785156b033ada /Lib/test/test_pathlib.py
parente0582a37c8d1776a2fd4968e9216f3a05f780276 (diff)
downloadcpython-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_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 962adde..e56e0d2 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -11,7 +11,6 @@ import unittest
from unittest import mock
from test import support
-android_not_root = support.android_not_root
TESTFN = support.TESTFN
try:
@@ -1911,10 +1910,12 @@ class _BasePathTest(object):
self.assertFalse((P / 'fileA' / 'bah').is_fifo())
@unittest.skipUnless(hasattr(os, "mkfifo"), "os.mkfifo() required")
- @unittest.skipIf(android_not_root, "mkfifo not allowed, non root user")
def test_is_fifo_true(self):
P = self.cls(BASE, 'myfifo')
- os.mkfifo(str(P))
+ try:
+ os.mkfifo(str(P))
+ except PermissionError as e:
+ self.skipTest('os.mkfifo(): %s' % e)
self.assertTrue(P.is_fifo())
self.assertFalse(P.is_socket())
self.assertFalse(P.is_file())