diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-09-14 08:43:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 08:43:04 -0700 |
commit | 18e95b4176256f100429a806d0455406df98f984 (patch) | |
tree | 93ee1ec40fe57593028605193ec1ccc45d7de841 /Lib/test/test_smtplib.py | |
parent | 1bbd482bcf6ea36bfe488f868810ffe110238ae1 (diff) | |
download | cpython-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_smtplib.py')
-rw-r--r-- | Lib/test/test_smtplib.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py index 4c9b7d367c..040ad4e059 100644 --- a/Lib/test/test_smtplib.py +++ b/Lib/test/test_smtplib.py @@ -611,7 +611,9 @@ class TooLongLineTests(unittest.TestCase): self.sock.settimeout(15) self.port = support.bind_port(self.sock) servargs = (self.evt, self.respdata, self.sock) - threading.Thread(target=server, args=servargs).start() + thread = threading.Thread(target=server, args=servargs) + thread.start() + self.addCleanup(thread.join) self.evt.wait() self.evt.clear() |