@@ -188,9 +188,6 @@ def test_access(self):
188188 os .close (f )
189189 self .assertTrue (os .access (os_helper .TESTFN , os .W_OK ))
190190
191- @unittest .skipIf (
192- support .is_emscripten , "Test is unstable under Emscripten."
193- )
194191 @unittest .skipIf (
195192 support .is_wasi , "WASI does not support dup."
196193 )
@@ -1428,9 +1425,7 @@ def setUp(self):
14281425 else :
14291426 self .sub2_tree = (sub2_path , ["SUB21" ], ["tmp3" ])
14301427
1431- if not support .is_emscripten :
1432- # Emscripten fails with inaccessible directory
1433- os .chmod (sub21_path , 0 )
1428+ os .chmod (sub21_path , 0 )
14341429 try :
14351430 os .listdir (sub21_path )
14361431 except PermissionError :
@@ -1726,9 +1721,6 @@ def test_yields_correct_dir_fd(self):
17261721 # check that listdir() returns consistent information
17271722 self .assertEqual (set (os .listdir (rootfd )), set (dirs ) | set (files ))
17281723
1729- @unittest .skipIf (
1730- support .is_emscripten , "Cannot dup stdout on Emscripten"
1731- )
17321724 @unittest .skipIf (
17331725 support .is_android , "dup return value is unpredictable on Android"
17341726 )
@@ -1745,9 +1737,6 @@ def test_fd_leak(self):
17451737 self .addCleanup (os .close , newfd )
17461738 self .assertEqual (newfd , minfd )
17471739
1748- @unittest .skipIf (
1749- support .is_emscripten , "Cannot dup stdout on Emscripten"
1750- )
17511740 @unittest .skipIf (
17521741 support .is_android , "dup return value is unpredictable on Android"
17531742 )
@@ -1816,8 +1805,8 @@ def test_makedir(self):
18161805 os .makedirs (path )
18171806
18181807 @unittest .skipIf (
1819- support .is_emscripten or support . is_wasi ,
1820- "Emscripten's/ WASI's umask is a stub."
1808+ support .is_wasi ,
1809+ "WASI's umask is a stub."
18211810 )
18221811 def test_mode (self ):
18231812 with os_helper .temp_umask (0o002 ):
@@ -1832,8 +1821,8 @@ def test_mode(self):
18321821 self .assertEqual (os .stat (parent ).st_mode & 0o777 , 0o775 )
18331822
18341823 @unittest .skipIf (
1835- support .is_emscripten or support . is_wasi ,
1836- "Emscripten's/ WASI's umask is a stub."
1824+ support .is_wasi ,
1825+ "WASI's umask is a stub."
18371826 )
18381827 def test_exist_ok_existing_directory (self ):
18391828 path = os .path .join (os_helper .TESTFN , 'dir1' )
@@ -1850,8 +1839,8 @@ def test_exist_ok_existing_directory(self):
18501839 os .makedirs (os .path .abspath ('/' ), exist_ok = True )
18511840
18521841 @unittest .skipIf (
1853- support .is_emscripten or support . is_wasi ,
1854- "Emscripten's/ WASI's umask is a stub."
1842+ support .is_wasi ,
1843+ "WASI's umask is a stub."
18551844 )
18561845 def test_exist_ok_s_isgid_directory (self ):
18571846 path = os .path .join (os_helper .TESTFN , 'dir1' )
@@ -2429,10 +2418,6 @@ def test_dup2(self):
24292418 self .check (os .dup2 , 20 )
24302419
24312420 @unittest .skipUnless (hasattr (os , 'dup2' ), 'test needs os.dup2()' )
2432- @unittest .skipIf (
2433- support .is_emscripten ,
2434- "dup2() with negative fds is broken on Emscripten (see gh-102179)"
2435- )
24362421 def test_dup2_negative_fd (self ):
24372422 valid_fd = os .open (__file__ , os .O_RDONLY )
24382423 self .addCleanup (os .close , valid_fd )
@@ -2457,14 +2442,14 @@ def test_fchown(self):
24572442 self .check (os .fchown , - 1 , - 1 )
24582443
24592444 @unittest .skipUnless (hasattr (os , 'fpathconf' ), 'test needs os.fpathconf()' )
2460- @unittest .skipIf (
2461- support .is_emscripten or support .is_wasi ,
2462- "musl libc issue on Emscripten/WASI, bpo-46390"
2463- )
24642445 def test_fpathconf (self ):
24652446 self .assertIn ("PC_NAME_MAX" , os .pathconf_names )
2466- self .check (os .pathconf , "PC_NAME_MAX" )
2467- self .check (os .fpathconf , "PC_NAME_MAX" )
2447+ if not (support .is_emscripten or support .is_wasi ):
2448+ # musl libc pathconf ignores the file descriptor and always returns
2449+ # a constant, so the assertion that it should notice a bad file
2450+ # descriptor and return EBADF fails.
2451+ self .check (os .pathconf , "PC_NAME_MAX" )
2452+ self .check (os .fpathconf , "PC_NAME_MAX" )
24682453 self .check_bool (os .pathconf , "PC_NAME_MAX" )
24692454 self .check_bool (os .fpathconf , "PC_NAME_MAX" )
24702455
@@ -3395,9 +3380,6 @@ def test_bad_fd(self):
33953380 @unittest .skipUnless (os .isatty (0 ) and not win32_is_iot () and (sys .platform .startswith ('win' ) or
33963381 (hasattr (locale , 'nl_langinfo' ) and hasattr (locale , 'CODESET' ))),
33973382 'test requires a tty and either Windows or nl_langinfo(CODESET)' )
3398- @unittest .skipIf (
3399- support .is_emscripten , "Cannot get encoding of stdin on Emscripten"
3400- )
34013383 def test_device_encoding (self ):
34023384 encoding = os .device_encoding (0 )
34033385 self .assertIsNotNone (encoding )
0 commit comments