Skip to content

Commit

Permalink
bpo-30175: Skip client cert tests of test_imaplib (#1320) (#1323)
Browse files Browse the repository at this point in the history
* bpo-30175: Skip client cert tests of test_imaplib

The IMAP server cyrus.andrew.cmu.edu doesn't accept our randomly
generated client x509 certificate anymore.

* bpo-30188: Catch EOFError in NetworkedNNTPTests

test_nntplib fails randomly with EOFError in
NetworkedNNTPTests.setUpClass(). Catch EOFError to skip tests in that
case.

(cherry picked from commit 5bccca5)
  • Loading branch information
vstinner authored Apr 27, 2017
1 parent 33a5568 commit 4dc3b9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Lib/test/test_imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,13 +966,19 @@ def test_logincapa(self):
_server = self.imap_class(self.host, self.port)
self.check_logincapa(_server)

@unittest.skipIf(True,
"bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn't accept "
"our randomly generated client x509 certificate anymore")
def test_logincapa_with_client_certfile(self):
with transient_internet(self.host):
with support.check_warnings(('', DeprecationWarning)):
_server = self.imap_class(self.host, self.port,
certfile=CERTFILE)
self.check_logincapa(_server)

@unittest.skipIf(True,
"bpo-30175: FIXME: cyrus.andrew.cmu.edu doesn't accept "
"our randomly generated client x509 certificate anymore")
def test_logincapa_with_client_ssl_context(self):
with transient_internet(self.host):
_server = self.imap_class(
Expand Down
7 changes: 6 additions & 1 deletion Lib/test/test_nntplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ class NetworkedNNTPTests(NetworkedNNTPTestsMixin, unittest.TestCase):
def setUpClass(cls):
support.requires("network")
with support.transient_internet(cls.NNTP_HOST):
cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
try:
cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT,
usenetrc=False)
except EOFError:
raise unittest.SkipTest(f"{cls} got EOF error on connecting "
f"to {cls.NNTP_HOST!r}")

@classmethod
def tearDownClass(cls):
Expand Down

0 comments on commit 4dc3b9c

Please sign in to comment.