summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 4686183..64cd80bc 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -16,7 +16,7 @@ try:
except ImportError:
ssl = None
-from unittest import TestCase
+from unittest import TestCase, skipUnless
from test import support
from test.support import HOST, HOSTv6
threading = support.import_module('threading')
@@ -779,6 +779,7 @@ class TestFTPClass(TestCase):
self.assertRaises(ftplib.Error, self.client.storlines, 'stor', f)
+@skipUnless(support.IPV6_ENABLED, "IPv6 not enabled")
class TestIPv6Environment(TestCase):
def setUp(self):
@@ -819,6 +820,7 @@ class TestIPv6Environment(TestCase):
retr()
+@skipUnless(ssl, "SSL not available")
class TestTLS_FTPClassMixin(TestFTPClass):
"""Repeat TestFTPClass tests starting the TLS layer for both control
and data connections first.
@@ -834,6 +836,7 @@ class TestTLS_FTPClassMixin(TestFTPClass):
self.client.prot_p()
+@skipUnless(ssl, "SSL not available")
class TestTLS_FTPClass(TestCase):
"""Specific TLS_FTP class tests."""
@@ -1015,12 +1018,9 @@ class TestTimeouts(TestCase):
def test_main():
- tests = [TestFTPClass, TestTimeouts]
- if support.IPV6_ENABLED:
- tests.append(TestIPv6Environment)
-
- if ssl is not None:
- tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])
+ tests = [TestFTPClass, TestTimeouts,
+ TestIPv6Environment,
+ TestTLS_FTPClassMixin, TestTLS_FTPClass]
thread_info = support.threading_setup()
try: