Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/python/cpython/src/patches/04-enable-subprocess-tests.patch
1067 views
1
Due to our new posix-node package, python-wasm does have subprocess support when
2
run on node.js. We want to test it fully, since we are using this to do
3
better builds form source, and we will also bring this to the browser.
4
Also, subprocess support itself is critical to enable a large amount of
5
the test suite itself, e.g., test/test_code.py *uses* subprocess support in
6
order to do all kinds of subtle tests of Python itself. Thus without subprocess
7
support, we can't really test our Python build properly. In contrast, fork
8
is nice but it's impossible to implement in a browser properly, sinc there's
9
no access to the WASM runtime stack, for security reasons. Also, it can't be
10
done efficiently in windows. Python *uses* for to implement subprocess support,
11
but that is just an implementation detail we get around.
12
13
--- native/Lib/test/support/__init__.py 2022-08-05 07:45:18.000000000 -0700
14
+++ wasm/Lib/test/support/__init__.py 2022-09-15 17:10:12.000000000 -0700
15
@@ -524,6 +524,8 @@
16
17
has_subprocess_support = not is_emscripten and not is_wasi
18
19
+has_subprocess_support = True
20
+
21
def requires_subprocess():
22
"""Used for subprocess, os.spawn calls, fd inheritance"""
23
return unittest.skipUnless(has_subprocess_support, "requires subprocess support")
24
@@ -531,6 +533,7 @@
25
# Emscripten's socket emulation and WASI sockets have limitations.
26
has_socket_support = not is_emscripten and not is_wasi
27
28
+
29
def requires_working_socket(*, module=False):
30
"""Skip tests or modules that require working sockets
31
32
33