mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
(cherry picked from commit 1f134e96ba
)
Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
307dacd651
commit
0fb70ce191
8 changed files with 26 additions and 7 deletions
|
@ -1,6 +1,11 @@
|
|||
import netrc, os, unittest, sys, textwrap
|
||||
from test.support import os_helper, run_unittest
|
||||
|
||||
try:
|
||||
import pwd
|
||||
except ImportError:
|
||||
pwd = None
|
||||
|
||||
temp_filename = os_helper.TESTFN
|
||||
|
||||
class NetrcTestCase(unittest.TestCase):
|
||||
|
@ -266,6 +271,7 @@ class NetrcTestCase(unittest.TestCase):
|
|||
|
||||
|
||||
@unittest.skipUnless(os.name == 'posix', 'POSIX only test')
|
||||
@unittest.skipIf(pwd is None, 'security check requires pwd module')
|
||||
def test_security(self):
|
||||
# This test is incomplete since we are normally not run as root and
|
||||
# therefore can't test the file ownership being wrong.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue