Skip to content

Commit 80a39da

Browse files
authored
gh-90473: Skip POSIX tests that don't apply to WASI (GH-93536)
1 parent 86a5e22 commit 80a39da

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Lib/test/test_posix.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
os_helper.TESTFN + '-dummy-symlink')
3232

3333
requires_32b = unittest.skipUnless(
34-
# Emscripten has 32 bits pointers, but support 64 bits syscall args.
35-
sys.maxsize < 2**32 and not support.is_emscripten,
34+
# Emscripten/WASI have 32 bits pointers, but support 64 bits syscall args.
35+
sys.maxsize < 2**32 and not (support.is_emscripten or support.is_wasi),
3636
'test is only meaningful on 32-bit builds'
3737
)
3838

@@ -547,6 +547,7 @@ def test_readv_overflow_32bits(self):
547547

548548
@unittest.skipUnless(hasattr(posix, 'dup'),
549549
'test needs posix.dup()')
550+
@unittest.skipIf(support.is_wasi, "WASI does not have dup()")
550551
def test_dup(self):
551552
fp = open(os_helper.TESTFN)
552553
try:
@@ -564,6 +565,7 @@ def test_confstr(self):
564565

565566
@unittest.skipUnless(hasattr(posix, 'dup2'),
566567
'test needs posix.dup2()')
568+
@unittest.skipIf(support.is_wasi, "WASI does not have dup2()")
567569
def test_dup2(self):
568570
fp1 = open(os_helper.TESTFN)
569571
fp2 = open(os_helper.TESTFN)
@@ -1212,6 +1214,7 @@ def test_sched_setaffinity(self):
12121214
# bpo-47205: does not raise OSError on FreeBSD
12131215
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
12141216

1217+
@unittest.skipIf(support.is_wasi, "No dynamic linking on WASI")
12151218
def test_rtld_constants(self):
12161219
# check presence of major RTLD_* constants
12171220
posix.RTLD_LAZY
@@ -1406,6 +1409,10 @@ def test_utime_dir_fd(self):
14061409
# whoops! using both together not supported on this platform.
14071410
pass
14081411

1412+
@unittest.skipIf(
1413+
support.is_wasi,
1414+
"WASI: symlink following on path_link is not supported"
1415+
)
14091416
@unittest.skipUnless(
14101417
hasattr(os, "link") and os.link in os.supports_dir_fd,
14111418
"test needs dir_fd support in os.link()"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy