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_stat.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_stat.py')
-rw-r--r-- | Lib/test/test_stat.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_stat.py b/Lib/test/test_stat.py index cd02a6e..73cd901 100644 --- a/Lib/test/test_stat.py +++ b/Lib/test/test_stat.py @@ -1,7 +1,7 @@ import unittest import os import sys -from test.support import TESTFN, import_fresh_module, android_not_root +from test.support import TESTFN, import_fresh_module c_stat = import_fresh_module('stat', fresh=['_stat']) py_stat = import_fresh_module('stat', blocked=['_stat']) @@ -168,9 +168,11 @@ class TestFilemode: self.assertS_IS("LNK", st_mode) @unittest.skipUnless(hasattr(os, 'mkfifo'), 'os.mkfifo not available') - @unittest.skipIf(android_not_root, "mkfifo not allowed, non root user") def test_fifo(self): - os.mkfifo(TESTFN, 0o700) + try: + os.mkfifo(TESTFN, 0o700) + except PermissionError as e: + self.skipTest('os.mkfifo(): %s' % e) st_mode, modestr = self.get_mode() self.assertEqual(modestr, 'prwx------') self.assertS_IS("FIFO", st_mode) |