summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-03-10 12:43:40 (GMT)
committerGitHub <noreply@github.com>2022-03-10 12:43:40 (GMT)
commitde554d6e02228b840eb6bffaf7d406c0ef368d5f (patch)
tree8e9cb21338d5fa7b71a3940d6c62c501d0f547a8 /Lib/test/test_pathlib.py
parent8714b6fa27271035dd6dd3514e283f92d669321d (diff)
downloadcpython-de554d6e02228b840eb6bffaf7d406c0ef368d5f.zip
cpython-de554d6e02228b840eb6bffaf7d406c0ef368d5f.tar.gz
cpython-de554d6e02228b840eb6bffaf7d406c0ef368d5f.tar.bz2
bpo-40280: Skip more tests/features that don't apply to Emscripten (GH-31791)
- fd inheritance can't be modified because Emscripten doesn't support subprocesses anyway. - setpriority always fails - geteuid no longer causes problems with latest emsdk - umask is a stub - geteuid / getuid always return 0, but process cannot chown to random uid.
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 713d279..66e4447 100644
--- a/Lib/test/test_pathlib.py
+++ b/Lib/test/test_pathlib.py
@@ -13,6 +13,7 @@ import unittest
from unittest import mock
from test.support import import_helper
+from test.support import is_emscripten
from test.support import os_helper
from test.support.os_helper import TESTFN, FakePath
@@ -2158,6 +2159,7 @@ class _BasePathTest(object):
self.assertTrue(p.exists())
self.assertEqual(p.stat().st_ctime, st_ctime_first)
+ @unittest.skipIf(is_emscripten, "FS root cannot be modified on Emscripten.")
def test_mkdir_exist_ok_root(self):
# Issue #25803: A drive root could raise PermissionError on Windows.
self.cls('/').resolve().mkdir(exist_ok=True)
@@ -2342,6 +2344,9 @@ class _BasePathTest(object):
self.assertIs((P / 'fileA\x00').is_socket(), False)
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
+ @unittest.skipIf(
+ is_emscripten, "Unix sockets are not implemented on Emscripten."
+ )
def test_is_socket_true(self):
P = self.cls(BASE, 'mysock')
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
@@ -2497,6 +2502,9 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
with self.assertRaises(RuntimeError):
print(path.resolve(strict))
+ @unittest.skipIf(
+ is_emscripten, "umask is not implemented on Emscripten."
+ )
def test_open_mode(self):
old_mask = os.umask(0)
self.addCleanup(os.umask, old_mask)
@@ -2520,6 +2528,9 @@ class PosixPathTest(_BasePathTest, unittest.TestCase):
finally:
os.chdir(current_directory)
+ @unittest.skipIf(
+ is_emscripten, "umask is not implemented on Emscripten."
+ )
def test_touch_mode(self):
old_mask = os.umask(0)
self.addCleanup(os.umask, old_mask)