mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-40280: Detect missing threading on WASM platforms (GH-32352)
Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
5aee46b31b
commit
2b16a08bc7
33 changed files with 103 additions and 21 deletions
|
@ -401,6 +401,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
|
||||
# sys._current_frames() is a CPython-only gimmick.
|
||||
@threading_helper.reap_threads
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_current_frames(self):
|
||||
import threading
|
||||
import traceback
|
||||
|
@ -466,6 +467,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
t.join()
|
||||
|
||||
@threading_helper.reap_threads
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_current_exceptions(self):
|
||||
import threading
|
||||
import traceback
|
||||
|
@ -1176,11 +1178,12 @@ class UnraisableHookTest(unittest.TestCase):
|
|||
for moduleName in 'builtins', '__main__', 'some_module':
|
||||
with self.subTest(moduleName=moduleName):
|
||||
A.B.X.__module__ = moduleName
|
||||
with test.support.captured_stderr() as stderr, \
|
||||
test.support.swap_attr(sys, 'unraisablehook',
|
||||
sys.__unraisablehook__):
|
||||
with test.support.captured_stderr() as stderr, test.support.swap_attr(
|
||||
sys, 'unraisablehook', sys.__unraisablehook__
|
||||
):
|
||||
expected = self.write_unraisable_exc(
|
||||
A.B.X(), "msg", "obj");
|
||||
A.B.X(), "msg", "obj"
|
||||
)
|
||||
report = stderr.getvalue()
|
||||
self.assertIn(A.B.X.__qualname__, report)
|
||||
if moduleName in ['builtins', '__main__']:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue