1313from unittest import mock
1414
1515from test .support import import_helper
16+ from test .support import is_emscripten
1617from test .support import os_helper
1718from test .support .os_helper import TESTFN , FakePath
1819
@@ -2158,6 +2159,7 @@ def test_mkdir_exist_ok_with_parent(self):
21582159 self .assertTrue (p .exists ())
21592160 self .assertEqual (p .stat ().st_ctime , st_ctime_first )
21602161
2162+ @unittest .skipIf (is_emscripten , "FS root cannot be modified on Emscripten." )
21612163 def test_mkdir_exist_ok_root (self ):
21622164 # Issue #25803: A drive root could raise PermissionError on Windows.
21632165 self .cls ('/' ).resolve ().mkdir (exist_ok = True )
@@ -2342,6 +2344,9 @@ def test_is_socket_false(self):
23422344 self .assertIs ((P / 'fileA\x00 ' ).is_socket (), False )
23432345
23442346 @unittest .skipUnless (hasattr (socket , "AF_UNIX" ), "Unix sockets required" )
2347+ @unittest .skipIf (
2348+ is_emscripten , "Unix sockets are not implemented on Emscripten."
2349+ )
23452350 def test_is_socket_true (self ):
23462351 P = self .cls (BASE , 'mysock' )
23472352 sock = socket .socket (socket .AF_UNIX , socket .SOCK_STREAM )
@@ -2497,6 +2502,9 @@ def _check_symlink_loop(self, *args, strict=True):
24972502 with self .assertRaises (RuntimeError ):
24982503 print (path .resolve (strict ))
24992504
2505+ @unittest .skipIf (
2506+ is_emscripten , "umask is not implemented on Emscripten."
2507+ )
25002508 def test_open_mode (self ):
25012509 old_mask = os .umask (0 )
25022510 self .addCleanup (os .umask , old_mask )
@@ -2520,6 +2528,9 @@ def test_resolve_root(self):
25202528 finally :
25212529 os .chdir (current_directory )
25222530
2531+ @unittest .skipIf (
2532+ is_emscripten , "umask is not implemented on Emscripten."
2533+ )
25232534 def test_touch_mode (self ):
25242535 old_mask = os .umask (0 )
25252536 self .addCleanup (os .umask , old_mask )
0 commit comments