From d71a7eee60cb10c26e1ad3f24b8d10b826235dfe Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 20 Jan 2025 12:17:29 -0800 Subject: [PATCH] use a subTest for sizes --- Lib/test/test_imaplib.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index e77be57f0824ef..2fbf83b264d5b4 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -902,6 +902,7 @@ def handle(self): self.imap_class, *server.server_address) def test_truncated_large_literal(self): + size = 0 class BadHandler(SimpleIMAPHandler): def handle(self): self._send_textline('* OK {%d}' % size) @@ -909,9 +910,10 @@ def handle(self): for exponent in range(15, 64): size = 1 << exponent - with self.reaped_server(BadHandler) as server: - with self.assertRaises(imaplib.IMAP4.abort): - self.imap_class(*server.server_address) + with self.subTest(f"size=2e{size}"): + with self.reaped_server(BadHandler) as server: + with self.assertRaises(imaplib.IMAP4.abort): + self.imap_class(*server.server_address) @threading_helper.reap_threads def test_simple_with_statement(self):