File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212from distutils import log
1313from distutils .tests import support
14- from test .support import run_unittest , is_emscripten
14+ from test .support import run_unittest , is_emscripten , is_wasi
1515
1616
1717class DirUtilTestCase (support .TempdirManager , unittest .TestCase ):
@@ -55,7 +55,10 @@ def test_mkpath_remove_tree_verbosity(self):
5555
5656 @unittest .skipIf (sys .platform .startswith ('win' ),
5757 "This test is only appropriate for POSIX-like systems." )
58- @unittest .skipIf (is_emscripten , "Emscripten's umask is a stub." )
58+ @unittest .skipIf (
59+ is_emscripten or is_wasi ,
60+ "Emscripten's/WASI's umask is a stub."
61+ )
5962 def test_mkpath_with_custom_mode (self ):
6063 # Get and set the current umask value for testing mode bits.
6164 umask = os .umask (0o002 )
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ def temp_umask(umask):
658658 yield
659659 finally :
660660 os .umask (oldmask )
661+ else :
662+ @contextlib .contextmanager
663+ def temp_umask (umask ):
664+ """no-op on platforms without umask()"""
665+ yield
661666
662667
663668class EnvironmentVarGuard (collections .abc .MutableMapping ):
Original file line number Diff line number Diff line change @@ -1607,6 +1607,10 @@ def test_mode(self):
16071607 self .assertEqual (os .stat (path ).st_mode & 0o777 , 0o555 )
16081608 self .assertEqual (os .stat (parent ).st_mode & 0o777 , 0o775 )
16091609
1610+ @unittest .skipIf (
1611+ support .is_emscripten or support .is_wasi ,
1612+ "Emscripten's/WASI's umask is a stub."
1613+ )
16101614 def test_exist_ok_existing_directory (self ):
16111615 path = os .path .join (os_helper .TESTFN , 'dir1' )
16121616 mode = 0o777
@@ -1621,6 +1625,10 @@ def test_exist_ok_existing_directory(self):
16211625 # Issue #25583: A drive root could raise PermissionError on Windows
16221626 os .makedirs (os .path .abspath ('/' ), exist_ok = True )
16231627
1628+ @unittest .skipIf (
1629+ support .is_emscripten or support .is_wasi ,
1630+ "Emscripten's/WASI's umask is a stub."
1631+ )
16241632 def test_exist_ok_s_isgid_directory (self ):
16251633 path = os .path .join (os_helper .TESTFN , 'dir1' )
16261634 S_ISGID = stat .S_ISGID
You can’t perform that action at this time.
0 commit comments