mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +00:00
gh-116303: Skip test module dependent tests if test modules are unavailable (#117341)
This commit is contained in:
parent
2ec6bb4111
commit
ea94b3b149
57 changed files with 255 additions and 123 deletions
|
@ -959,6 +959,7 @@ class ThreadTests(BaseTestCase):
|
|||
|
||||
@cpython_only
|
||||
def test_frame_tstate_tracing(self):
|
||||
_testcapi = import_module("_testcapi")
|
||||
# Issue #14432: Crash when a generator is created in a C thread that is
|
||||
# destroyed while the generator is still used. The issue was that a
|
||||
# generator contains a frame, and the frame kept a reference to the
|
||||
|
@ -986,7 +987,6 @@ class ThreadTests(BaseTestCase):
|
|||
threading.settrace(noop_trace)
|
||||
|
||||
# Create a generator in a C thread which exits after the call
|
||||
import _testcapi
|
||||
_testcapi.call_in_temporary_c_thread(callback)
|
||||
|
||||
# Call the generator in a different Python thread, check that the
|
||||
|
@ -1490,6 +1490,7 @@ class SubinterpThreadingTests(BaseTestCase):
|
|||
|
||||
@cpython_only
|
||||
def test_daemon_threads_fatal_error(self):
|
||||
import_module("_testcapi")
|
||||
subinterp_code = f"""if 1:
|
||||
import os
|
||||
import threading
|
||||
|
@ -1516,6 +1517,7 @@ class SubinterpThreadingTests(BaseTestCase):
|
|||
daemon_allowed=True,
|
||||
daemon=False,
|
||||
):
|
||||
import_module("_testinternalcapi")
|
||||
subinterp_code = textwrap.dedent(f"""
|
||||
import test.support
|
||||
import threading
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue