Issue #18702: All skipped tests now reported as skipped.
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index 9505c22..e9b6daf 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -11,7 +11,7 @@
import time
import errno
-from unittest import TestCase
+from unittest import TestCase, skipUnless
from test import test_support
from test.test_support import HOST
threading = test_support.import_module('threading')
@@ -263,17 +263,20 @@
else:
DummyPOP3Handler.handle_read(self)
- class TestPOP3_SSLClass(TestPOP3Class):
- # repeat previous tests by using poplib.POP3_SSL
+requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
- def setUp(self):
- self.server = DummyPOP3Server((HOST, 0))
- self.server.handler = DummyPOP3_SSLHandler
- self.server.start()
- self.client = poplib.POP3_SSL(self.server.host, self.server.port)
+@requires_ssl
+class TestPOP3_SSLClass(TestPOP3Class):
+ # repeat previous tests by using poplib.POP3_SSL
- def test__all__(self):
- self.assertIn('POP3_SSL', poplib.__all__)
+ def setUp(self):
+ self.server = DummyPOP3Server((HOST, 0))
+ self.server.handler = DummyPOP3_SSLHandler
+ self.server.start()
+ self.client = poplib.POP3_SSL(self.server.host, self.server.port)
+
+ def test__all__(self):
+ self.assertIn('POP3_SSL', poplib.__all__)
class TestTimeouts(TestCase):
@@ -331,9 +334,8 @@
def test_main():
- tests = [TestPOP3Class, TestTimeouts]
- if SUPPORTS_SSL:
- tests.append(TestPOP3_SSLClass)
+ tests = [TestPOP3Class, TestTimeouts,
+ TestPOP3_SSLClass]
thread_info = test_support.threading_setup()
try:
test_support.run_unittest(*tests)