[Python-checkins] bpo-36348: test_imaplib: add debug info (GH-12846)

Victor Stinner webhook-mailer at python.org
Mon Apr 15 12:45:08 EDT 2019


https://github.com/python/cpython/commit/2815bf5b1f39b9f677135473392887a8d261fc97
commit: 2815bf5b1f39b9f677135473392887a8d261fc97
branch: 3.7
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-04-15T18:45:01+02:00
summary:

bpo-36348: test_imaplib: add debug info (GH-12846)

Log more info if tests fail.

files:
M Lib/test/test_imaplib.py

diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py
index aec36af6c525..9305e47ee993 100644
--- a/Lib/test/test_imaplib.py
+++ b/Lib/test/test_imaplib.py
@@ -470,8 +470,8 @@ def test_logout(self):
         self.assertEqual(typ, 'OK')
         self.assertEqual(data[0], b'LOGIN completed')
         typ, data = client.logout()
-        self.assertEqual(typ, 'BYE')
-        self.assertEqual(data[0], b'IMAP4ref1 Server logging out')
+        self.assertEqual(typ, 'BYE', (typ, data))
+        self.assertEqual(data[0], b'IMAP4ref1 Server logging out', (typ, data))
         self.assertEqual(client.state, 'LOGOUT')
 
     def test_lsub(self):
@@ -937,7 +937,7 @@ def test_logout(self):
         with transient_internet(self.host):
             rs = self.server.logout()
             self.server = None
-            self.assertEqual(rs[0], 'BYE')
+            self.assertEqual(rs[0], 'BYE', rs)
 
 
 @unittest.skipUnless(ssl, "SSL not available")
@@ -995,7 +995,7 @@ def test_logout(self):
         with transient_internet(self.host):
             _server = self.imap_class(self.host, self.port)
             rs = _server.logout()
-            self.assertEqual(rs[0], 'BYE')
+            self.assertEqual(rs[0], 'BYE', rs)
 
     def test_ssl_context_certfile_exclusive(self):
         with transient_internet(self.host):



More information about the Python-checkins mailing list