summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/support/__init__.py2
-rw-r--r--Lib/test/test__locale.py6
-rw-r--r--Lib/test/test_cmd_line_script.py3
-rw-r--r--Lib/test/test_coroutines.py3
-rw-r--r--Lib/test/test_genericpath.py2
-rw-r--r--Lib/test/test_inspect.py5
-rw-r--r--Lib/test/test_locale.py12
-rw-r--r--Lib/test/test_pydoc.py8
-rw-r--r--Lib/test/test_pyexpat.py3
-rw-r--r--Lib/test/test_re.py12
-rw-r--r--Lib/test/test_robotparser.py5
-rw-r--r--Lib/test/test_selectors.py4
-rw-r--r--Lib/test/test_support.py2
-rw-r--r--Lib/test/test_venv.py6
14 files changed, 49 insertions, 24 deletions
diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index bddfe11..e4bda94 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -521,7 +521,7 @@ def requires_subprocess():
"""Used for subprocess, os.spawn calls, fd inheritance"""
return unittest.skipUnless(has_subprocess_support, "requires subprocess support")
-# Emscripten's socket emulation has limitation. WASI doesn't have sockets yet.
+# Emscripten's socket emulation and WASI sockets have limitations.
has_socket_support = not is_emscripten and not is_wasi
def requires_working_socket(*, module=False):
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index b3bc54c..0947464 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -109,7 +109,8 @@ class _LocaleTests(unittest.TestCase):
@unittest.skipUnless(nl_langinfo, "nl_langinfo is not available")
@unittest.skipIf(
- support.is_emscripten, "musl libc issue on Emscripten, bpo-46390"
+ support.is_emscripten or support.is_wasi,
+ "musl libc issue on Emscripten, bpo-46390"
)
def test_lc_numeric_nl_langinfo(self):
# Test nl_langinfo against known values
@@ -128,7 +129,8 @@ class _LocaleTests(unittest.TestCase):
self.skipTest('no suitable locales')
@unittest.skipIf(
- support.is_emscripten, "musl libc issue on Emscripten, bpo-46390"
+ support.is_emscripten or support.is_wasi,
+ "musl libc issue on Emscripten, bpo-46390"
)
def test_lc_numeric_localeconv(self):
# Test localeconv against known values
diff --git a/Lib/test/test_cmd_line_script.py b/Lib/test/test_cmd_line_script.py
index bb433dc..d783af6 100644
--- a/Lib/test/test_cmd_line_script.py
+++ b/Lib/test/test_cmd_line_script.py
@@ -558,8 +558,9 @@ class CmdLineTest(unittest.TestCase):
# Mac OS X denies the creation of a file with an invalid UTF-8 name.
# Windows allows creating a name with an arbitrary bytes name, but
# Python cannot a undecodable bytes argument to a subprocess.
+ # WASI does not permit invalid UTF-8 names.
if (os_helper.TESTFN_UNDECODABLE
- and sys.platform not in ('win32', 'darwin')):
+ and sys.platform not in ('win32', 'darwin', 'emscripten', 'wasi')):
name = os.fsdecode(os_helper.TESTFN_UNDECODABLE)
elif os_helper.TESTFN_NONASCII:
name = os_helper.TESTFN_NONASCII
diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py
index 77944e6..dba5cef 100644
--- a/Lib/test/test_coroutines.py
+++ b/Lib/test/test_coroutines.py
@@ -2209,7 +2209,8 @@ class CoroutineTest(unittest.TestCase):
@unittest.skipIf(
- support.is_emscripten, "asyncio does not work under Emscripten yet."
+ support.is_emscripten or support.is_wasi,
+ "asyncio does not work under Emscripten/WASI yet."
)
class CoroAsyncIOCompatTest(unittest.TestCase):
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py
index 2741adc..489044f 100644
--- a/Lib/test/test_genericpath.py
+++ b/Lib/test/test_genericpath.py
@@ -484,7 +484,7 @@ class CommonTest(GenericTest):
# invalid UTF-8 name. Windows allows creating a directory with an
# arbitrary bytes name, but fails to enter this directory
# (when the bytes name is used).
- and sys.platform not in ('win32', 'darwin', 'emscripten')):
+ and sys.platform not in ('win32', 'darwin', 'emscripten', 'wasi')):
name = os_helper.TESTFN_UNDECODABLE
elif os_helper.TESTFN_NONASCII:
name = os_helper.TESTFN_NONASCII
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index fe0259a..ae18427 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -842,7 +842,10 @@ class TestBuggyCases(GetSourceBase):
self.assertSourceEqual(mod2.cls213, 218, 222)
self.assertSourceEqual(mod2.cls213().func219(), 220, 221)
- @unittest.skipIf(support.is_emscripten, "socket.accept is broken")
+ @unittest.skipIf(
+ support.is_emscripten or support.is_wasi,
+ "socket.accept is broken"
+ )
def test_nested_class_definition_inside_async_function(self):
import asyncio
self.addCleanup(asyncio.set_event_loop_policy, None)
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 5cb6edc..bc8a7a3 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -1,5 +1,5 @@
from decimal import Decimal
-from test.support import verbose, is_android, is_emscripten
+from test.support import verbose, is_android, is_emscripten, is_wasi
from test.support.warnings_helper import check_warnings
import unittest
import locale
@@ -373,13 +373,19 @@ class TestEnUSCollation(BaseLocalizedTest, TestCollation):
@unittest.skipIf(sys.platform.startswith('aix'),
'bpo-29972: broken test on AIX')
- @unittest.skipIf(is_emscripten, "musl libc issue on Emscripten, bpo-46390")
+ @unittest.skipIf(
+ is_emscripten or is_wasi,
+ "musl libc issue on Emscripten/WASI, bpo-46390"
+ )
def test_strcoll_with_diacritic(self):
self.assertLess(locale.strcoll('à', 'b'), 0)
@unittest.skipIf(sys.platform.startswith('aix'),
'bpo-29972: broken test on AIX')
- @unittest.skipIf(is_emscripten, "musl libc issue on Emscripten, bpo-46390")
+ @unittest.skipIf(
+ is_emscripten or is_wasi,
+ "musl libc issue on Emscripten/WASI, bpo-46390"
+ )
def test_strxfrm_with_diacritic(self):
self.assertLess(locale.strxfrm('à'), locale.strxfrm('b'))
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py
index 13c77b6..ac181ef 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -27,7 +27,8 @@ from test.support import os_helper
from test.support.script_helper import assert_python_ok, assert_python_failure
from test.support import threading_helper
from test.support import (reap_children, captured_output, captured_stdout,
- captured_stderr, is_emscripten, requires_docstrings)
+ captured_stderr, is_emscripten, is_wasi,
+ requires_docstrings)
from test.support.os_helper import (TESTFN, rmtree, unlink)
from test import pydoc_mod
@@ -1356,7 +1357,10 @@ foo
)
-@unittest.skipIf(is_emscripten, "Socket server not available on Emscripten.")
+@unittest.skipIf(
+ is_emscripten or is_wasi,
+ "Socket server not available on Emscripten/WASI."
+)
class PydocServerTest(unittest.TestCase):
"""Tests for pydoc._start_server"""
diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py
index 6e57845..6f0441b 100644
--- a/Lib/test/test_pyexpat.py
+++ b/Lib/test/test_pyexpat.py
@@ -12,7 +12,7 @@ import traceback
from xml.parsers import expat
from xml.parsers.expat import errors
-from test.support import sortdict, is_emscripten
+from test.support import sortdict, is_emscripten, is_wasi
class SetAttributeTest(unittest.TestCase):
@@ -469,6 +469,7 @@ class HandlerExceptionTest(unittest.TestCase):
if (sysconfig.is_python_build()
and not (sys.platform == 'win32' and platform.machine() == 'ARM')
and not is_emscripten
+ and not is_wasi
):
self.assertIn('call_with_frame("StartElement"', entries[1][3])
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index ba70de4..52ee616 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1,6 +1,6 @@
from test.support import (gc_collect, bigmemtest, _2G,
cpython_only, captured_stdout,
- check_disallow_instantiation, is_emscripten)
+ check_disallow_instantiation, is_emscripten, is_wasi)
import locale
import re
import string
@@ -1943,7 +1943,10 @@ class ReTests(unittest.TestCase):
# with ignore case.
self.assertEqual(re.fullmatch('[a-c]+', 'ABC', re.I).span(), (0, 3))
- @unittest.skipIf(is_emscripten, "musl libc issue on Emscripten, bpo-46390")
+ @unittest.skipIf(
+ is_emscripten or is_wasi,
+ "musl libc issue on Emscripten/WASI, bpo-46390"
+ )
def test_locale_caching(self):
# Issue #22410
oldlocale = locale.setlocale(locale.LC_CTYPE)
@@ -1980,7 +1983,10 @@ class ReTests(unittest.TestCase):
self.assertIsNone(re.match(b'(?Li)\xc5', b'\xe5'))
self.assertIsNone(re.match(b'(?Li)\xe5', b'\xc5'))
- @unittest.skipIf(is_emscripten, "musl libc issue on Emscripten, bpo-46390")
+ @unittest.skipIf(
+ is_emscripten or is_wasi,
+ "musl libc issue on Emscripten/WASI, bpo-46390"
+ )
def test_locale_compiled(self):
oldlocale = locale.setlocale(locale.LC_CTYPE)
self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
diff --git a/Lib/test/test_robotparser.py b/Lib/test/test_robotparser.py
index 3821d66..8d89e2a 100644
--- a/Lib/test/test_robotparser.py
+++ b/Lib/test/test_robotparser.py
@@ -308,8 +308,9 @@ class RobotHandler(BaseHTTPRequestHandler):
pass
-@unittest.skipIf(
- support.is_emscripten, "Socket server not available on Emscripten."
+@unittest.skipUnless(
+ support.has_socket_support,
+ "Socket server requires working socket."
)
class PasswordProtectedSiteTestCase(unittest.TestCase):
diff --git a/Lib/test/test_selectors.py b/Lib/test/test_selectors.py
index c927331..c2db88c 100644
--- a/Lib/test/test_selectors.py
+++ b/Lib/test/test_selectors.py
@@ -19,8 +19,8 @@ except ImportError:
resource = None
-if support.is_emscripten:
- raise unittest.SkipTest("Cannot create socketpair on Emscripten.")
+if support.is_emscripten or support.is_wasi:
+ raise unittest.SkipTest("Cannot create socketpair on Emscripten/WASI.")
if hasattr(socket, 'socketpair'):
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index dce4980..7a8b681 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -691,7 +691,7 @@ class TestSupport(unittest.TestCase):
'Warning -- a\nWarning -- b\n')
def test_has_strftime_extensions(self):
- if support.is_emscripten or support.is_wasi or sys.platform == "win32":
+ if support.is_emscripten or sys.platform == "win32":
self.assertFalse(support.has_strftime_extensions)
else:
self.assertTrue(support.has_strftime_extensions)
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 4f89752..9f2ecf3 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -16,7 +16,7 @@ import sys
import tempfile
from test.support import (captured_stdout, captured_stderr, requires_zlib,
skip_if_broken_multiprocessing_synchronize, verbose,
- requires_subprocess, is_emscripten,
+ requires_subprocess, is_emscripten, is_wasi,
requires_venv_with_pip)
from test.support.os_helper import (can_symlink, EnvironmentVarGuard, rmtree)
import unittest
@@ -35,8 +35,8 @@ requireVenvCreate = unittest.skipUnless(
or sys._base_executable != sys.executable,
'cannot run venv.create from within a venv on this platform')
-if is_emscripten:
- raise unittest.SkipTest("venv is not available on Emscripten.")
+if is_emscripten or is_wasi:
+ raise unittest.SkipTest("venv is not available on Emscripten/WASI.")
@requires_subprocess()
def check_output(cmd, encoding=None):