Commit c90e19dd authored by Victor Stinner's avatar Victor Stinner

Close #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".

Patch written by Charles-Francois Natali.
parent afbc8506
...@@ -648,7 +648,7 @@ class TestFTPClass(TestCase): ...@@ -648,7 +648,7 @@ class TestFTPClass(TestCase):
class TestIPv6Environment(TestCase): class TestIPv6Environment(TestCase):
def setUp(self): def setUp(self):
self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6) self.server = DummyFTPServer(('::1', 0), af=socket.AF_INET6)
self.server.start() self.server.start()
self.client = ftplib.FTP() self.client = ftplib.FTP()
self.client.connect(self.server.host, self.server.port) self.client.connect(self.server.host, self.server.port)
...@@ -874,12 +874,7 @@ class TestTimeouts(TestCase): ...@@ -874,12 +874,7 @@ class TestTimeouts(TestCase):
def test_main(): def test_main():
tests = [TestFTPClass, TestTimeouts] tests = [TestFTPClass, TestTimeouts]
if support.IPV6_ENABLED: if support.IPV6_ENABLED:
try: tests.append(TestIPv6Environment)
DummyFTPServer((HOST, 0), af=socket.AF_INET6)
except socket.error:
pass
else:
tests.append(TestIPv6Environment)
if ssl is not None: if ssl is not None:
tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass]) tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass])
......
...@@ -534,6 +534,9 @@ Extensions ...@@ -534,6 +534,9 @@ Extensions
Tests Tests
----- -----
- Issue #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
Patch written by Charles-Francois Natali.
- Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use - Issue #8407, #11859: Fix tests of test_io using threads and an alarm: use
pthread_sigmask() to ensure that the SIGALRM signal is received by the main pthread_sigmask() to ensure that the SIGALRM signal is received by the main
thread. thread.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment