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
(cherry picked from commit 1f134e96ba)

Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
Miss Islington (bot) 2022-05-25 07:24:32 -07:00 committed by GitHub
parent 307dacd651
commit 0fb70ce191
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 7 deletions

View file

@ -1498,7 +1498,10 @@ class StreamWriteTest(WriteTestBase, unittest.TestCase):
@unittest.skipUnless(sys.platform != "win32" and hasattr(os, "umask"),
"Missing umask implementation")
@unittest.skipIf(support.is_emscripten, "Emscripten's umask is a stub.")
@unittest.skipIf(
support.is_emscripten or support.is_wasi,
"Emscripten's/WASI's umask is a stub."
)
def test_file_mode(self):
# Test for issue #8464: Create files with correct
# permissions.