Issue #19857: Make sure that test_imaplib reaps server threads even in face of

error upon client disconnection.
parent 933142a8
...@@ -210,13 +210,12 @@ class BaseThreadedNetworkedTests(unittest.TestCase): ...@@ -210,13 +210,12 @@ class BaseThreadedNetworkedTests(unittest.TestCase):
@contextmanager @contextmanager
def reaped_pair(self, hdlr): def reaped_pair(self, hdlr):
server, thread = self.make_server((support.HOST, 0), hdlr) with self.reaped_server(hdlr) as server:
client = self.imap_class(*server.server_address) client = self.imap_class(*server.server_address)
try: try:
yield server, client yield server, client
finally: finally:
client.logout() client.logout()
self.reap_server(server, thread)
@reap_threads @reap_threads
def test_connect(self): def test_connect(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment