mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
Release all forwarded functions in .close. Fixes #1513223.
This commit is contained in:
parent
a09803329c
commit
7596e8342e
3 changed files with 34 additions and 14 deletions
|
@ -582,6 +582,21 @@ class BasicUDPTest(ThreadedUDPSocketTest):
|
|||
def _testRecvFrom(self):
|
||||
self.cli.sendto(MSG, 0, (HOST, PORT))
|
||||
|
||||
class TCPCloserTest(ThreadedTCPSocketTest):
|
||||
|
||||
def testClose(self):
|
||||
conn, addr = self.serv.accept()
|
||||
conn.close()
|
||||
|
||||
sd = self.cli
|
||||
read, write, err = select.select([sd], [], [], 1.0)
|
||||
self.assertEqual(read, [sd])
|
||||
self.assertEqual(sd.recv(1), '')
|
||||
|
||||
def _testClose(self):
|
||||
self.cli.connect((HOST, PORT))
|
||||
time.sleep(1.0)
|
||||
|
||||
class BasicSocketPairTest(SocketPairTest):
|
||||
|
||||
def __init__(self, methodName='runTest'):
|
||||
|
@ -890,8 +905,8 @@ class BufferIOTest(SocketConnectedTest):
|
|||
self.serv_conn.send(buf)
|
||||
|
||||
def test_main():
|
||||
tests = [GeneralModuleTests, BasicTCPTest, TCPTimeoutTest, TestExceptions,
|
||||
BufferIOTest]
|
||||
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
|
||||
TestExceptions, BufferIOTest]
|
||||
if sys.platform != 'mac':
|
||||
tests.extend([ BasicUDPTest, UDPTimeoutTest ])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue