summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ftplib.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-06-30 15:36:57 (GMT)
committerGitHub <noreply@github.com>2017-06-30 15:36:57 (GMT)
commit73528640ffd872141e126d2c4a103126055ec9ce (patch)
tree3aad4f755fad2d542fec3f1874d811777f6e553e /Lib/test/test_ftplib.py
parent45dba3af50cfa359dc2e40abe4306bd0b11d1315 (diff)
downloadcpython-73528640ffd872141e126d2c4a103126055ec9ce.zip
cpython-73528640ffd872141e126d2c4a103126055ec9ce.tar.gz
cpython-73528640ffd872141e126d2c4a103126055ec9ce.tar.bz2
bpo-30818: test_ftplib calls asyncore.close_all() (#2514)
Always clear asyncore socket map using asyncore.close_all(ignore_all=True) in tearDown() method. This change should fix this warning: Warning -- asyncore.socket_map was modified by test_ftplib Before: {} After: {4: <test.test_ftplib.DummyTLS_FTPServer 127.0.0.1:0 at 0x805feccf0>}
Diffstat (limited to 'Lib/test/test_ftplib.py')
-rw-r--r--Lib/test/test_ftplib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index 12fabc5..6571816 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -470,6 +470,7 @@ class TestFTPClass(TestCase):
def tearDown(self):
self.client.close()
self.server.stop()
+ asyncore.close_all(ignore_all=True)
def check_data(self, received, expected):
self.assertEqual(len(received), len(expected))
@@ -795,6 +796,7 @@ class TestIPv6Environment(TestCase):
def tearDown(self):
self.client.close()
self.server.stop()
+ asyncore.close_all(ignore_all=True)
def test_af(self):
self.assertEqual(self.client.af, socket.AF_INET6)
@@ -853,6 +855,7 @@ class TestTLS_FTPClass(TestCase):
def tearDown(self):
self.client.close()
self.server.stop()
+ asyncore.close_all(ignore_all=True)
def test_control_connection(self):
self.assertNotIsInstance(self.client.sock, ssl.SSLSocket)