]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.11] gh-116831: Fixes tests for c extension in WASI for Python 3.11 (GH-116831...
authorKushal Das <mail@kushaldas.in>
Mon, 18 Mar 2024 06:03:01 +0000 (07:03 +0100)
committerGitHub <noreply@github.com>
Mon, 18 Mar 2024 06:03:01 +0000 (07:03 +0100)
gh-116831: Fixes tests for c extension in WASI

We can skip the C extension based tests under WASI.

Lib/test/test_imp.py

index 4062afd725487028c3514ed434f3207fcda96ead..aa67cc3514e43ea16c77ba10761c64851267a0bb 100644 (file)
@@ -10,6 +10,7 @@ from test.support import import_helper
 from test.support import os_helper
 from test.support import script_helper
 from test.support import warnings_helper
+from test.support import is_wasi
 import unittest
 import warnings
 imp = warnings_helper.import_deprecated('imp')
@@ -23,6 +24,8 @@ def requires_load_dynamic(meth):
     """Decorator to skip a test if not running under CPython or lacking
     imp.load_dynamic()."""
     meth = support.cpython_only(meth)
+    if is_wasi:
+        return unittest.skipIf(True, 'Not supoorted in WASI')(meth)
     return unittest.skipIf(getattr(imp, 'load_dynamic', None) is None,
                            'imp.load_dynamic() required')(meth)