diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-30 23:23:03 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-04-30 23:23:03 (GMT) |
commit | c90e19dd3fe3945f0f828d5918df11ec44976fcb (patch) | |
tree | 345a1b38b1c9ff5e5217d38489a1e1105c6b1992 /Lib/test | |
parent | afbc8506a1c91b4735e10b7358ae7f8910fca0e9 (diff) | |
download | cpython-c90e19dd3fe3945f0f828d5918df11ec44976fcb.zip cpython-c90e19dd3fe3945f0f828d5918df11ec44976fcb.tar.gz cpython-c90e19dd3fe3945f0f828d5918df11ec44976fcb.tar.bz2 |
Close #11958: Fix FTP tests for IPv6, bind to "::1" instead of "localhost".
Patch written by Charles-Francois Natali.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_ftplib.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py index cfdfa2c..6dbe2b6 100644 --- a/Lib/test/test_ftplib.py +++ b/Lib/test/test_ftplib.py @@ -648,7 +648,7 @@ class TestFTPClass(TestCase): class TestIPv6Environment(TestCase): 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.client = ftplib.FTP() self.client.connect(self.server.host, self.server.port) @@ -874,12 +874,7 @@ class TestTimeouts(TestCase): def test_main(): tests = [TestFTPClass, TestTimeouts] if support.IPV6_ENABLED: - try: - DummyFTPServer((HOST, 0), af=socket.AF_INET6) - except socket.error: - pass - else: - tests.append(TestIPv6Environment) + tests.append(TestIPv6Environment) if ssl is not None: tests.extend([TestTLS_FTPClassMixin, TestTLS_FTPClass]) |