summaryrefslogtreecommitdiff
path: root/Lib/test/test_imaplib.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-09-14 14:40:56 -0700
committerGitHub <noreply@github.com>2017-09-14 14:40:56 -0700
commitb9b69003d91c6ea94b890ce24ed25686d30f1428 (patch)
tree51ff0c32353a7f82e02879bd7b8efd36ffc17ca9 /Lib/test/test_imaplib.py
parent167cbde50a88ec2a7d26b2cb9891d5e32bdfbfb5 (diff)
downloadcpython-git-b9b69003d91c6ea94b890ce24ed25686d30f1428.tar.gz
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.
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r--Lib/test/test_imaplib.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index 132c58624f..2b62b05a59 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -220,7 +220,9 @@ class NewIMAPTestsMixin():
# cleanup the server
self.server.shutdown()
self.server.server_close()
- self.thread.join(3.0)
+ support.join_thread(self.thread, 3.0)
+ # Explicitly clear the attribute to prevent dangling thread
+ self.thread = None
def test_EOF_without_complete_welcome_message(self):
# http://bugs.python.org/issue5949