File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 11
11
12
12
from distutils import log
13
13
from distutils .tests import support
14
- from test .support import run_unittest , is_emscripten
14
+ from test .support import run_unittest , is_emscripten , is_wasi
15
15
16
16
17
17
class DirUtilTestCase (support .TempdirManager , unittest .TestCase ):
@@ -55,7 +55,10 @@ def test_mkpath_remove_tree_verbosity(self):
55
55
56
56
@unittest .skipIf (sys .platform .startswith ('win' ),
57
57
"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
+ )
59
62
def test_mkpath_with_custom_mode (self ):
60
63
# Get and set the current umask value for testing mode bits.
61
64
umask = os .umask (0o002 )
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ def temp_umask(umask):
658
658
yield
659
659
finally :
660
660
os .umask (oldmask )
661
+ else :
662
+ @contextlib .contextmanager
663
+ def temp_umask (umask ):
664
+ """no-op on platforms without umask()"""
665
+ yield
661
666
662
667
663
668
class EnvironmentVarGuard (collections .abc .MutableMapping ):
Original file line number Diff line number Diff line change @@ -1607,6 +1607,10 @@ def test_mode(self):
1607
1607
self .assertEqual (os .stat (path ).st_mode & 0o777 , 0o555 )
1608
1608
self .assertEqual (os .stat (parent ).st_mode & 0o777 , 0o775 )
1609
1609
1610
+ @unittest .skipIf (
1611
+ support .is_emscripten or support .is_wasi ,
1612
+ "Emscripten's/WASI's umask is a stub."
1613
+ )
1610
1614
def test_exist_ok_existing_directory (self ):
1611
1615
path = os .path .join (os_helper .TESTFN , 'dir1' )
1612
1616
mode = 0o777
@@ -1621,6 +1625,10 @@ def test_exist_ok_existing_directory(self):
1621
1625
# Issue #25583: A drive root could raise PermissionError on Windows
1622
1626
os .makedirs (os .path .abspath ('/' ), exist_ok = True )
1623
1627
1628
+ @unittest .skipIf (
1629
+ support .is_emscripten or support .is_wasi ,
1630
+ "Emscripten's/WASI's umask is a stub."
1631
+ )
1624
1632
def test_exist_ok_s_isgid_directory (self ):
1625
1633
path = os .path .join (os_helper .TESTFN , 'dir1' )
1626
1634
S_ISGID = stat .S_ISGID
You can’t perform that action at this time.
0 commit comments