mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
Issue #28078: Silence resource warnings in test_socket. Initial patch by Xiang Zhang, thanks
This commit is contained in:
parent
015d874626
commit
02b3035bc3
1 changed files with 15 additions and 11 deletions
|
|
@ -5347,7 +5347,9 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
|
|||
sock.bind((typ, name))
|
||||
except FileNotFoundError as e:
|
||||
# type / algorithm is not available
|
||||
sock.close()
|
||||
raise unittest.SkipTest(str(e), typ, name)
|
||||
else
|
||||
return sock
|
||||
|
||||
def test_sha256(self):
|
||||
|
|
@ -5494,6 +5496,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
|
|||
|
||||
def test_sendmsg_afalg_args(self):
|
||||
sock = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0)
|
||||
with sock:
|
||||
with self.assertRaises(TypeError):
|
||||
sock.sendmsg_afalg()
|
||||
|
||||
|
|
@ -5509,6 +5512,7 @@ class LinuxKernelCryptoAPI(unittest.TestCase):
|
|||
with self.assertRaises(TypeError):
|
||||
sock.sendmsg_afalg(op=socket.ALG_OP_ENCRYPT, assoclen=-1)
|
||||
|
||||
|
||||
def test_main():
|
||||
tests = [GeneralModuleTests, BasicTCPTest, TCPCloserTest, TCPTimeoutTest,
|
||||
TestExceptions, BufferIOTest, BasicTCPTest2, BasicUDPTest, UDPTimeoutTest ]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue