[Python-checkins] bpo-30188: test_nntplib catch also ssl.SSLEOFError (#2843)

Victor Stinner webhook-mailer at python.org
Mon Jul 24 11:41:05 EDT 2017


https://github.com/python/cpython/commit/5b4feb7e86ecb813b2c56560f86cda2fd46b9579
commit: 5b4feb7e86ecb813b2c56560f86cda2fd46b9579
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017-07-24T17:41:02+02:00
summary:

bpo-30188: test_nntplib catch also ssl.SSLEOFError (#2843)

Catch also ssl.SSLEOFError in NetworkedNNTPTests setUpClass().
EOFError was already catched.

files:
M Lib/test/test_nntplib.py

diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index 3e84f3429ee..482de66e3f4 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -274,6 +274,11 @@ def is_connected():
 NetworkedNNTPTestsMixin.wrap_methods()
 
 
+EOF_ERRORS = [EOFError]
+if ssl is not None:
+    EOF_ERRORS.append(ssl.SSLEOFError)
+
+
 class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
     # This server supports STARTTLS (gmane doesn't)
     NNTP_HOST = 'news.trigofacile.com'
@@ -289,7 +294,7 @@ def setUpClass(cls):
             try:
                 cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT,
                                             usenetrc=False)
-            except EOFError:
+            except EOF_ERRORS:
                 raise unittest.SkipTest(f"{cls} got EOF error on connecting "
                                         f"to {cls.NNTP_HOST!r}")
 



More information about the Python-checkins mailing list