2020-07-07 14:21:33 +00:00
|
|
|
From 0eb0ea9aeb5a5cfdceb35547dd1a97d73914338b Mon Sep 17 00:00:00 2001
|
|
|
|
From: Michael Droettboom <mdboom@gmail.com>
|
|
|
|
Date: Sun, 5 Jul 2020 19:56:47 +0200
|
|
|
|
Subject: [PATCH] testing
|
|
|
|
|
2021-06-19 22:49:25 +00:00
|
|
|
---
|
|
|
|
Lib/platform.py | 2 +-
|
|
|
|
Lib/test/libregrtest/main.py | 4 +++-
|
|
|
|
Lib/test/support/script_helper.py | 5 +++++
|
|
|
|
Lib/test/test_cgi.py | 1 +
|
|
|
|
Lib/test/test_fcntl.py | 2 ++
|
|
|
|
Lib/test/test_gzip.py | 2 ++
|
|
|
|
Lib/test/test_itertools.py | 1 +
|
|
|
|
7 files changed, 15 insertions(+), 2 deletions(-)
|
2020-07-07 14:21:33 +00:00
|
|
|
|
|
|
|
diff --git a/Lib/platform.py b/Lib/platform.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 0bce438..8fdfe05 100755
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/platform.py
|
|
|
|
+++ b/Lib/platform.py
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -614,7 +614,7 @@ def _syscmd_file(target, default=''):
|
2020-07-07 14:21:33 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
diff --git a/Lib/test/libregrtest/main.py b/Lib/test/libregrtest/main.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index e20bf9a..18f62f4 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/test/libregrtest/main.py
|
|
|
|
+++ b/Lib/test/libregrtest/main.py
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -639,7 +639,9 @@ class Regrtest:
|
2020-07-07 14:21:33 +00:00
|
|
|
except SystemExit as exc:
|
|
|
|
# bpo-38203: Python can hang at exit in Py_Finalize(), especially
|
|
|
|
# on threading._shutdown() call: put a timeout
|
|
|
|
- faulthandler.dump_traceback_later(EXIT_TIMEOUT, exit=True)
|
|
|
|
+
|
|
|
|
+ # Skipping, pyodide doesn't support threading.
|
|
|
|
+ # faulthandler.dump_traceback_later(EXIT_TIMEOUT, exit=True)
|
|
|
|
|
|
|
|
sys.exit(exc.code)
|
|
|
|
|
|
|
|
diff --git a/Lib/test/support/script_helper.py b/Lib/test/support/script_helper.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 37e576d..d470e4a 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- 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
|
2021-06-19 22:49:25 +00:00
|
|
|
from test.support import make_legacy_pyc
|
2020-07-07 14:21:33 +00:00
|
|
|
@@ -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
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -171,6 +174,8 @@ def spawn_python(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
|
2020-07-07 14:21:33 +00:00
|
|
|
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_cgi.py b/Lib/test/test_cgi.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 4e1506a..8c02cdb 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/test/test_cgi.py
|
|
|
|
+++ b/Lib/test/test_cgi.py
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -221,6 +221,7 @@ Content-Length: 3
|
2020-07-07 14:21:33 +00:00
|
|
|
self.assertEqual(fs.getvalue(key), expect_val[0])
|
|
|
|
|
|
|
|
def test_log(self):
|
|
|
|
+ raise unittest.SkipTest('known pyodide failure')
|
|
|
|
cgi.log("Testing")
|
|
|
|
|
|
|
|
cgi.logfp = StringIO()
|
|
|
|
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 9ab68c6..3e74849 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/test/test_fcntl.py
|
|
|
|
+++ b/Lib/test/test_fcntl.py
|
2020-12-31 17:19:24 +00:00
|
|
|
@@ -155,6 +155,7 @@ class TestFcntl(unittest.TestCase):
|
2020-07-07 14:21:33 +00:00
|
|
|
|
|
|
|
@unittest.skipIf(platform.system() == "AIX", "AIX returns PermissionError")
|
|
|
|
def test_lockf_exclusive(self):
|
|
|
|
+ raise unittest.SkipTest('threading not supported')
|
|
|
|
self.f = open(TESTFN, 'wb+')
|
|
|
|
cmd = fcntl.LOCK_EX | fcntl.LOCK_NB
|
|
|
|
fcntl.lockf(self.f, cmd)
|
2020-12-31 17:19:24 +00:00
|
|
|
@@ -166,6 +167,7 @@ class TestFcntl(unittest.TestCase):
|
2020-07-07 14:21:33 +00:00
|
|
|
|
|
|
|
@unittest.skipIf(platform.system() == "AIX", "AIX returns PermissionError")
|
|
|
|
def test_lockf_share(self):
|
|
|
|
+ raise unittest.SkipTest('threading not supported')
|
|
|
|
self.f = open(TESTFN, 'wb+')
|
|
|
|
cmd = fcntl.LOCK_SH | fcntl.LOCK_NB
|
|
|
|
fcntl.lockf(self.f, cmd)
|
|
|
|
diff --git a/Lib/test/test_gzip.py b/Lib/test/test_gzip.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 1af23c6..045b4c7 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/test/test_gzip.py
|
|
|
|
+++ b/Lib/test/test_gzip.py
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -743,6 +743,7 @@ class TestCommandLine(unittest.TestCase):
|
2020-07-07 14:21:33 +00:00
|
|
|
data = b'This is a simple test with gzip'
|
|
|
|
|
|
|
|
def test_decompress_stdin_stdout(self):
|
|
|
|
+ raise unittest.SkipTest('no subprocess')
|
|
|
|
with io.BytesIO() as bytes_io:
|
|
|
|
with gzip.GzipFile(fileobj=bytes_io, mode='wb') as gzip_file:
|
|
|
|
gzip_file.write(self.data)
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -779,6 +780,7 @@ class TestCommandLine(unittest.TestCase):
|
2020-07-07 14:21:33 +00:00
|
|
|
|
|
|
|
@create_and_remove_directory(TEMPDIR)
|
|
|
|
def test_compress_stdin_outfile(self):
|
|
|
|
+ raise unittest.SkipTest('no subprocess')
|
|
|
|
args = sys.executable, '-m', 'gzip'
|
|
|
|
with Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE) as proc:
|
|
|
|
out, err = proc.communicate(self.data)
|
|
|
|
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
|
2021-06-19 22:49:25 +00:00
|
|
|
index 7101264..bf359a0 100644
|
2020-07-07 14:21:33 +00:00
|
|
|
--- a/Lib/test/test_itertools.py
|
|
|
|
+++ b/Lib/test/test_itertools.py
|
2021-06-19 22:49:25 +00:00
|
|
|
@@ -1513,6 +1513,7 @@ class TestBasicOps(unittest.TestCase):
|
2020-07-07 14:21:33 +00:00
|
|
|
next(a)
|
|
|
|
|
|
|
|
def test_tee_concurrent(self):
|
|
|
|
+ raise unittest.SkipTest('threading not supported')
|
|
|
|
start = threading.Event()
|
|
|
|
finish = threading.Event()
|
|
|
|
class I:
|
|
|
|
--
|
2021-06-19 22:49:25 +00:00
|
|
|
2.17.1
|
2020-07-07 14:21:33 +00:00
|
|
|
|