bpo-31234: Add support.join_thread() helper (#3587)

join_thread() joins a thread but raises an AssertionError if the
thread is still alive after timeout seconds.
This commit is contained in:
Victor Stinner 2017-09-14 14:40:56 -07:00 committed by GitHub
parent 167cbde50a
commit b9b69003d9
9 changed files with 50 additions and 65 deletions

View file

@ -808,7 +808,7 @@ class EventLoopTestsMixin:
proto.transport.close()
lsock.close()
thread.join(1)
support.join_thread(thread, timeout=1)
self.assertFalse(thread.is_alive())
self.assertEqual(proto.state, 'CLOSED')
self.assertEqual(proto.nbytes, len(message))