mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +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
|
@ -1451,6 +1451,7 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests):
|
|||
self.assertEqual(b"abcdefg", bufio.read())
|
||||
|
||||
@support.requires_resource('cpu')
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_threads(self):
|
||||
try:
|
||||
# Write out many bytes with exactly the same number of 0's,
|
||||
|
@ -1825,6 +1826,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
|
|||
self.assertEqual(f.tell(), buffer_size + 2)
|
||||
|
||||
@support.requires_resource('cpu')
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_threads(self):
|
||||
try:
|
||||
# Write out many bytes from many threads and test they were
|
||||
|
@ -1895,6 +1897,7 @@ class BufferedWriterTest(unittest.TestCase, CommonBufferedTests):
|
|||
self.assertRaises(OSError, b.close) # exception not swallowed
|
||||
self.assertTrue(b.closed)
|
||||
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_slow_close_from_thread(self):
|
||||
# Issue #31976
|
||||
rawio = self.SlowFlushRawIO()
|
||||
|
@ -3287,6 +3290,7 @@ class TextIOWrapperTest(unittest.TestCase):
|
|||
self.assertEqual(f.errors, "replace")
|
||||
|
||||
@support.no_tracing
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_threads_write(self):
|
||||
# Issue6750: concurrent writes could duplicate data
|
||||
event = threading.Event()
|
||||
|
@ -4362,9 +4366,11 @@ class CMiscIOTest(MiscIOTest):
|
|||
else:
|
||||
self.assertFalse(err.strip('.!'))
|
||||
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_daemon_threads_shutdown_stdout_deadlock(self):
|
||||
self.check_daemon_threads_shutdown_deadlock('stdout')
|
||||
|
||||
@threading_helper.requires_working_threading()
|
||||
def test_daemon_threads_shutdown_stderr_deadlock(self):
|
||||
self.check_daemon_threads_shutdown_deadlock('stderr')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue