gh-90473: Misc test fixes for WASI (GH-93218)

* ``sys.executable`` is not set
* WASI does not support subprocess
* ``pwd`` module is not available
* WASI checks ``open`` syscall flags more strict, needs r, w, rw flag.
* ``umask`` is not available
* ``/dev/null`` may not be accessible
This commit is contained in:
Christian Heimes 2022-05-25 15:57:26 +02:00 committed by GitHub
parent 5e6e5b98a8
commit 1f134e96ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 7 deletions

View file

@ -63,7 +63,7 @@ class TestPgen2Caching(support.TestCase):
@unittest.skipIf(sys.executable is None, 'sys.executable required')
@unittest.skipIf(
sys.platform == 'emscripten', 'requires working subprocess'
sys.platform in {'emscripten', 'wasi'}, 'requires working subprocess'
)
def test_load_grammar_from_subprocess(self):
tmpdir = tempfile.mkdtemp()