mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-90473: WASI: Mark tests that require os.pipe() (GH-92837)
This commit is contained in:
parent
3ed1cae9ed
commit
730902c0ad
4 changed files with 14 additions and 0 deletions
|
@ -429,6 +429,7 @@ class IOTest(unittest.TestCase):
|
|||
@unittest.skipIf(
|
||||
support.is_emscripten, "fstat() of a pipe fd is not supported"
|
||||
)
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_optional_abilities(self):
|
||||
# Test for OSError when optional APIs are not supported
|
||||
# The purpose of this test is to try fileno(), reading, writing and
|
||||
|
@ -3970,6 +3971,7 @@ class MiscIOTest(unittest.TestCase):
|
|||
@unittest.skipIf(
|
||||
support.is_emscripten, "fstat() of a pipe fd is not supported"
|
||||
)
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_open_pipe_with_append(self):
|
||||
# bpo-27805: Ignore ESPIPE from lseek() in open().
|
||||
r, w = os.pipe()
|
||||
|
@ -4108,6 +4110,7 @@ class MiscIOTest(unittest.TestCase):
|
|||
with warnings_helper.check_no_resource_warning(self):
|
||||
open(r, *args, closefd=False, **kwargs)
|
||||
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_warn_on_dealloc_fd(self):
|
||||
self._check_warn_on_dealloc_fd("rb", buffering=0)
|
||||
self._check_warn_on_dealloc_fd("rb")
|
||||
|
@ -4147,6 +4150,7 @@ class MiscIOTest(unittest.TestCase):
|
|||
|
||||
@unittest.skipUnless(hasattr(os, 'set_blocking'),
|
||||
'os.set_blocking() required for this test')
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def _test_nonblock_pipe_write(self, bufsize):
|
||||
sent = []
|
||||
received = []
|
||||
|
@ -4458,14 +4462,17 @@ class SignalsTest(unittest.TestCase):
|
|||
raise
|
||||
|
||||
@requires_alarm
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_interrupted_write_unbuffered(self):
|
||||
self.check_interrupted_write(b"xy", b"xy", mode="wb", buffering=0)
|
||||
|
||||
@requires_alarm
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_interrupted_write_buffered(self):
|
||||
self.check_interrupted_write(b"xy", b"xy", mode="wb")
|
||||
|
||||
@requires_alarm
|
||||
@unittest.skipUnless(hasattr(os, "pipe"), "requires os.pipe()")
|
||||
def test_interrupted_write_text(self):
|
||||
self.check_interrupted_write("xy", b"xy", mode="w", encoding="ascii")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue