mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
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:
parent
5e6e5b98a8
commit
1f134e96ba
8 changed files with 26 additions and 7 deletions
|
|
@ -1765,6 +1765,7 @@ class RemoveDirsTests(unittest.TestCase):
|
|||
self.assertTrue(os.path.exists(os_helper.TESTFN))
|
||||
|
||||
|
||||
@unittest.skipIf(support.is_wasi, "WASI has no /dev/null")
|
||||
class DevNullTests(unittest.TestCase):
|
||||
def test_devnull(self):
|
||||
with open(os.devnull, 'wb', 0) as f:
|
||||
|
|
@ -2111,6 +2112,7 @@ class Win32ErrorTests(unittest.TestCase):
|
|||
self.assertRaises(OSError, os.chmod, os_helper.TESTFN, 0)
|
||||
|
||||
|
||||
@unittest.skipIf(support.is_wasi, "Cannot create invalid FD on WASI.")
|
||||
class TestInvalidFD(unittest.TestCase):
|
||||
singles = ["fchdir", "dup", "fdatasync", "fstat",
|
||||
"fstatvfs", "fsync", "tcgetpgrp", "ttyname"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue