mirror of
https://github.com/python/cpython
synced 2024-09-05 00:05:39 +00:00
gh-111912: Run test_posix on Windows (GH-111913)
This commit is contained in:
parent
65d6dc2715
commit
64fea3211d
|
@ -6,9 +6,6 @@
|
|||
from test.support import warnings_helper
|
||||
from test.support.script_helper import assert_python_ok
|
||||
|
||||
# Skip these tests if there is no posix module.
|
||||
posix = import_helper.import_module('posix')
|
||||
|
||||
import errno
|
||||
import sys
|
||||
import signal
|
||||
|
@ -22,6 +19,11 @@
|
|||
import textwrap
|
||||
from contextlib import contextmanager
|
||||
|
||||
try:
|
||||
import posix
|
||||
except ImportError:
|
||||
import nt as posix
|
||||
|
||||
try:
|
||||
import pwd
|
||||
except ImportError:
|
||||
|
@ -1009,6 +1011,7 @@ def test_environ(self):
|
|||
self.assertEqual(type(k), item_type)
|
||||
self.assertEqual(type(v), item_type)
|
||||
|
||||
@unittest.skipUnless(os.name == 'posix', "see bug gh-111841")
|
||||
def test_putenv(self):
|
||||
with self.assertRaises(ValueError):
|
||||
os.putenv('FRUIT\0VEGETABLE', 'cabbage')
|
||||
|
@ -1220,6 +1223,7 @@ def test_sched_setaffinity(self):
|
|||
self.assertRaises(OSError, posix.sched_setaffinity, -1, mask)
|
||||
|
||||
@unittest.skipIf(support.is_wasi, "No dynamic linking on WASI")
|
||||
@unittest.skipUnless(os.name == 'posix', "POSIX-only test")
|
||||
def test_rtld_constants(self):
|
||||
# check presence of major RTLD_* constants
|
||||
posix.RTLD_LAZY
|
||||
|
|
Loading…
Reference in a new issue