summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-09-14 20:05:21 (GMT)
committerGitHub <noreply@github.com>2017-09-14 20:05:21 (GMT)
commitb8c7be2c523b012e57915182543d06657161057f (patch)
tree3cd95822a4b9d1316af813bad4495bcb1b02b8da /Lib
parentc8d8e15bfc24abeeaaf3d8be9073276b0c011cdf (diff)
downloadcpython-b8c7be2c523b012e57915182543d06657161057f.zip
cpython-b8c7be2c523b012e57915182543d06657161057f.tar.gz
cpython-b8c7be2c523b012e57915182543d06657161057f.tar.bz2
bpo-31234: Join threads in test_threading (#3579)
Call thread.join() to prevent the "dangling thread" warning.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_threading.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index 912eb3f..ab383c2 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -578,6 +578,7 @@ class ThreadTests(BaseTestCase):
self.assertFalse(t.is_alive())
# And verify the thread disposed of _tstate_lock.
self.assertIsNone(t._tstate_lock)
+ t.join()
def test_repr_stopped(self):
# Verify that "stopped" shows up in repr(Thread) appropriately.
@@ -604,6 +605,7 @@ class ThreadTests(BaseTestCase):
break
time.sleep(0.01)
self.assertIn(LOOKING_FOR, repr(t)) # we waited at least 5 seconds
+ t.join()
def test_BoundedSemaphore_limit(self):
# BoundedSemaphore should raise ValueError if released too often.
@@ -918,6 +920,7 @@ class ThreadingExceptionTests(BaseTestCase):
thread = threading.Thread()
thread.start()
self.assertRaises(RuntimeError, thread.start)
+ thread.join()
def test_joining_current_thread(self):
current_thread = threading.current_thread()
@@ -931,6 +934,7 @@ class ThreadingExceptionTests(BaseTestCase):
thread = threading.Thread()
thread.start()
self.assertRaises(RuntimeError, setattr, thread, "daemon", True)
+ thread.join()
def test_releasing_unacquired_lock(self):
lock = threading.Lock()