summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-07-24 15:41:02 (GMT)
committerGitHub <noreply@github.com>2017-07-24 15:41:02 (GMT)
commit5b4feb7e86ecb813b2c56560f86cda2fd46b9579 (patch)
treec0e86dee7a1d24612ae2d8b3c1f81af3b624dc3a /Lib/test
parent06634950c553f8df83330ed468c11483b857b7dc (diff)
downloadcpython-5b4feb7e86ecb813b2c56560f86cda2fd46b9579.zip
cpython-5b4feb7e86ecb813b2c56560f86cda2fd46b9579.tar.gz
cpython-5b4feb7e86ecb813b2c56560f86cda2fd46b9579.tar.bz2
bpo-30188: test_nntplib catch also ssl.SSLEOFError (#2843)
Catch also ssl.SSLEOFError in NetworkedNNTPTests setUpClass(). EOFError was already catched.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_nntplib.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index 3e84f34..482de66 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -274,6 +274,11 @@ class NetworkedNNTPTestsMixin:
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 @@ class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
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}")