Path: blob/main/python/cpython/src/patches/04-enable-subprocess-tests.patch
1067 views
Due to our new posix-node package, python-wasm does have subprocess support when1run on node.js. We want to test it fully, since we are using this to do2better builds form source, and we will also bring this to the browser.3Also, subprocess support itself is critical to enable a large amount of4the test suite itself, e.g., test/test_code.py *uses* subprocess support in5order to do all kinds of subtle tests of Python itself. Thus without subprocess6support, we can't really test our Python build properly. In contrast, fork7is nice but it's impossible to implement in a browser properly, sinc there's8no access to the WASM runtime stack, for security reasons. Also, it can't be9done efficiently in windows. Python *uses* for to implement subprocess support,10but that is just an implementation detail we get around.1112--- native/Lib/test/support/__init__.py 2022-08-05 07:45:18.000000000 -070013+++ wasm/Lib/test/support/__init__.py 2022-09-15 17:10:12.000000000 -070014@@ -524,6 +524,8 @@1516has_subprocess_support = not is_emscripten and not is_wasi1718+has_subprocess_support = True19+20def requires_subprocess():21"""Used for subprocess, os.spawn calls, fd inheritance"""22return unittest.skipUnless(has_subprocess_support, "requires subprocess support")23@@ -531,6 +533,7 @@24# Emscripten's socket emulation and WASI sockets have limitations.25has_socket_support = not is_emscripten and not is_wasi2627+28def requires_working_socket(*, module=False):29"""Skip tests or modules that require working sockets30313233