pyodide/cpython/patches/testing.patch

85 lines
2.7 KiB
Diff

diff --git a/Lib/platform.py b/Lib/platform.py
index 20f9817f4f..bcf96874c0 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -748,7 +748,7 @@ def _syscmd_uname(option, default=''):
""" Interface to the system's uname command.
"""
- if sys.platform in ('dos', 'win32', 'win16'):
+ if sys.platform in ('dos', 'win32', 'win16', 'emscripten'):
# XXX Others too ?
return default
try:
@@ -771,7 +771,7 @@ def _syscmd_file(target, default=''):
default in case the command should fail.
"""
- if sys.platform in ('dos', 'win32', 'win16'):
+ if sys.platform in ('dos', 'win32', 'win16', 'emscripten'):
# XXX Others too ?
return default
target = _follow_symlinks(target)
diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py
index 64b25aab80..7cf67fd149 100644
--- a/Lib/test/support/script_helper.py
+++ b/Lib/test/support/script_helper.py
@@ -9,6 +9,7 @@ import os.path
import subprocess
import py_compile
import zipfile
+import unittest
from importlib.util import source_from_cache
from test.support import make_legacy_pyc, strip_python_stderr
@@ -34,6 +35,8 @@ def interpreter_requires_environment():
situation. PYTHONPATH or PYTHONUSERSITE are other common environment
variables that might impact whether or not the interpreter can start.
"""
+ raise unittest.SkipTest('no subprocess')
+
global __cached_interp_requires_environment
if __cached_interp_requires_environment is None:
# If PYTHONHOME is set, assume that we need it
@@ -172,6 +175,8 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
kw is extra keyword args to pass to subprocess.Popen. Returns a Popen
object.
"""
+ raise unittest.SkipTest("no subprocess")
+
cmd_line = [sys.executable]
if not interpreter_requires_environment():
cmd_line.append('-E')
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 55faf4c427..b2201c09e7 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -104,7 +104,10 @@ consts: ('None',)
import inspect
import sys
-import threading
+try:
+ import threading
+except ImportError:
+ import dummy_threading as threading
import unittest
import weakref
try:
diff --git a/Lib/test/test_import/__init__.py b/Lib/test/test_import/__init__.py
index 1fc4de11e1..e6c91707ae 100644
--- a/Lib/test/test_import/__init__.py
+++ b/Lib/test/test_import/__init__.py
@@ -10,7 +10,10 @@ import py_compile
import random
import stat
import sys
-import threading
+try:
+ import threading
+except ImportError:
+ import dummy_threading as threading
import time
import unittest
import unittest.mock as mock