mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Add socket cleanup for ResourceWarning and update test to use skip decorator
This commit is contained in:
parent
4841fd60fb
commit
5ad0bd69c9
1 changed files with 2 additions and 2 deletions
|
@ -592,15 +592,15 @@ class GeneralModuleTests(unittest.TestCase):
|
|||
finally:
|
||||
sock.close()
|
||||
|
||||
@unittest.skipUnless(os.name == "nt", "Windows specific")
|
||||
def test_sock_ioctl(self):
|
||||
if os.name != "nt":
|
||||
return
|
||||
self.assertTrue(hasattr(socket.socket, 'ioctl'))
|
||||
self.assertTrue(hasattr(socket, 'SIO_RCVALL'))
|
||||
self.assertTrue(hasattr(socket, 'RCVALL_ON'))
|
||||
self.assertTrue(hasattr(socket, 'RCVALL_OFF'))
|
||||
self.assertTrue(hasattr(socket, 'SIO_KEEPALIVE_VALS'))
|
||||
s = socket.socket()
|
||||
self.addCleanup(s.close)
|
||||
self.assertRaises(ValueError, s.ioctl, -1, None)
|
||||
s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue