mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
#8594: fix ResourceWarning in test_ftplib.py - patch by Nadeem Vawda.
This commit is contained in:
parent
684d78cfb0
commit
7a2114719d
1 changed files with 2 additions and 2 deletions
|
|
@ -619,8 +619,8 @@ class TestFTPClass(TestCase):
|
|||
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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue