diff options
| author | Erlend E. Aasland <erlend@python.org> | 2024-04-03 13:11:36 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-03 13:11:36 (GMT) |
| commit | ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e (patch) | |
| tree | 7fc58f8dcd7513427c7ea2ff9d7bad523be1118a /Lib/test/test_os.py | |
| parent | 2ec6bb4111d2c03c1cac02b27c74beee7e5a2a05 (diff) | |
| download | cpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.zip cpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.tar.gz cpython-ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e.tar.bz2 | |
gh-116303: Skip test module dependent tests if test modules are unavailable (#117341)
Diffstat (limited to 'Lib/test/test_os.py')
| -rw-r--r-- | Lib/test/test_os.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 00b415f..094ac13 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -57,8 +57,10 @@ try: except (ImportError, AttributeError): all_users = [] try: + import _testcapi from _testcapi import INT_MAX, PY_SSIZE_T_MAX except ImportError: + _testcapi = None INT_MAX = PY_SSIZE_T_MAX = sys.maxsize try: @@ -5338,6 +5340,7 @@ class ForkTests(unittest.TestCase): @unittest.skipUnless(sys.platform in ("linux", "android", "darwin"), "Only Linux and macOS detect this today.") + @unittest.skipIf(_testcapi is None, "requires _testcapi") def test_fork_warns_when_non_python_thread_exists(self): code = """if 1: import os, threading, warnings |
