summaryrefslogtreecommitdiff
path: root/Lib/test/test_concurrent_futures.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-09-14 08:43:04 -0700
committerGitHub <noreply@github.com>2017-09-14 08:43:04 -0700
commit18e95b4176256f100429a806d0455406df98f984 (patch)
tree93ee1ec40fe57593028605193ec1ccc45d7de841 /Lib/test/test_concurrent_futures.py
parent1bbd482bcf6ea36bfe488f868810ffe110238ae1 (diff)
downloadcpython-git-18e95b4176256f100429a806d0455406df98f984.tar.gz
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.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_concurrent_futures.py b/Lib/test/test_concurrent_futures.py
index 7bc733efb1..57dc994d28 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():