diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-03 01:51:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-03 01:51:43 (GMT) |
commit | 0025350294959594e7f57aef4fc9579c77a0ed1c (patch) | |
tree | 8fb501ae17c33b278f4a9a2aa38a96b8b5f35164 /Lib/test/test_thread.py | |
parent | 13136e83a637a9f1cfbada7e93097005296659b4 (diff) | |
download | cpython-0025350294959594e7f57aef4fc9579c77a0ed1c.zip cpython-0025350294959594e7f57aef4fc9579c77a0ed1c.tar.gz cpython-0025350294959594e7f57aef4fc9579c77a0ed1c.tar.bz2 |
bpo-37069: tests use catch_unraisable_exception() (GH-13762)
Modify test_coroutines, test_cprofile, test_generators, test_raise,
test_ssl and test_yield_from to use
support.catch_unraisable_exception() rather than
support.captured_stderr().
test_thread: remove test_save_exception_state_on_error() which is now
updated. test_unraisable_exception() checks that sys.unraisablehook()
is called to handle _thread.start_new_thread() exception.
test_cprofile now rely on unittest for test discovery: replace
support.run_unittest() with unittest.main().
Diffstat (limited to 'Lib/test/test_thread.py')
-rw-r--r-- | Lib/test/test_thread.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/Lib/test/test_thread.py b/Lib/test/test_thread.py index f946f7b..9f4801f 100644 --- a/Lib/test/test_thread.py +++ b/Lib/test/test_thread.py @@ -133,27 +133,6 @@ class ThreadRunningTests(BasicThreadTest): time.sleep(POLL_SLEEP) self.assertEqual(thread._count(), orig) - def test_save_exception_state_on_error(self): - # See issue #14474 - def task(): - started.release() - raise SyntaxError - def mywrite(self, *args): - try: - raise ValueError - except ValueError: - pass - real_write(self, *args) - started = thread.allocate_lock() - with support.captured_output("stderr") as stderr: - real_write = stderr.write - stderr.write = mywrite - started.acquire() - with support.wait_threads_exit(): - thread.start_new_thread(task, ()) - started.acquire() - self.assertIn("Traceback", stderr.getvalue()) - def test_unraisable_exception(self): def task(): started.release() |