diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-09-14 15:43:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 15:43:04 (GMT) |
commit | 18e95b4176256f100429a806d0455406df98f984 (patch) | |
tree | 93ee1ec40fe57593028605193ec1ccc45d7de841 /Lib/test/test_concurrent_futures.py | |
parent | 1bbd482bcf6ea36bfe488f868810ffe110238ae1 (diff) | |
download | cpython-18e95b4176256f100429a806d0455406df98f984.zip cpython-18e95b4176256f100429a806d0455406df98f984.tar.gz cpython-18e95b4176256f100429a806d0455406df98f984.tar.bz2 |
bpo-31234: Join threads in tests (#3572)
Call thread.join() on threads to prevent the "dangling threads"
warning.
Diffstat (limited to 'Lib/test/test_concurrent_futures.py')
-rw-r--r-- | Lib/test/test_concurrent_futures.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py index 7bc733e..57dc994 100644 --- a/Lib/test/test_concurrent_futures.py +++ b/Lib/test/test_concurrent_futures.py @@ -772,6 +772,7 @@ class FutureTests(BaseTestCase): t.start() self.assertEqual(f1.result(timeout=5), 42) + t.join() def test_result_with_cancel(self): # TODO(brian@sweetapp.com): This test is timing dependent. @@ -785,6 +786,7 @@ class FutureTests(BaseTestCase): t.start() self.assertRaises(futures.CancelledError, f1.result, timeout=5) + t.join() def test_exception_with_timeout(self): self.assertRaises(futures.TimeoutError, @@ -813,6 +815,7 @@ class FutureTests(BaseTestCase): t.start() self.assertTrue(isinstance(f1.exception(timeout=5), OSError)) + t.join() @test.support.reap_threads def test_main(): |