[Python-checkins] r88761 - python/branches/py3k/Lib/test/test_ftplib.py

giampaolo.rodola python-checkins at python.org
Sun Mar 6 22:04:48 CET 2011


Author: giampaolo.rodola
Date: Sun Mar  6 22:04:47 2011
New Revision: 88761

Log:
Fix ResourceWarning in test_ftplib.py - patch by Nadeem Vawda

Modified:
   python/branches/py3k/Lib/test/test_ftplib.py

Modified: python/branches/py3k/Lib/test/test_ftplib.py
==============================================================================
--- python/branches/py3k/Lib/test/test_ftplib.py	(original)
+++ python/branches/py3k/Lib/test/test_ftplib.py	Sun Mar  6 22:04:47 2011
@@ -619,8 +619,8 @@
     def test_source_address_passive_connection(self):
         port = support.find_unused_port()
         self.client.source_address = (HOST, port)
-        sock = self.client.transfercmd('list')
-        self.assertEqual(sock.getsockname()[1], port)
+        with self.client.transfercmd('list') as sock:
+            self.assertEqual(sock.getsockname()[1], port)
 
     def test_parse257(self):
         self.assertEqual(ftplib.parse257('257 "/foo/bar"'), '/foo/bar')


More information about the Python-checkins mailing list