Commit 5ad0bd69 authored by Brian Curtin's avatar Brian Curtin

Add socket cleanup for ResourceWarning and update test to use skip decorator

parent 4841fd60
...@@ -592,15 +592,15 @@ class GeneralModuleTests(unittest.TestCase): ...@@ -592,15 +592,15 @@ class GeneralModuleTests(unittest.TestCase):
finally: finally:
sock.close() sock.close()
@unittest.skipUnless(os.name == "nt", "Windows specific")
def test_sock_ioctl(self): def test_sock_ioctl(self):
if os.name != "nt":
return
self.assertTrue(hasattr(socket.socket, 'ioctl')) self.assertTrue(hasattr(socket.socket, 'ioctl'))
self.assertTrue(hasattr(socket, 'SIO_RCVALL')) self.assertTrue(hasattr(socket, 'SIO_RCVALL'))
self.assertTrue(hasattr(socket, 'RCVALL_ON')) self.assertTrue(hasattr(socket, 'RCVALL_ON'))
self.assertTrue(hasattr(socket, 'RCVALL_OFF')) self.assertTrue(hasattr(socket, 'RCVALL_OFF'))
self.assertTrue(hasattr(socket, 'SIO_KEEPALIVE_VALS')) self.assertTrue(hasattr(socket, 'SIO_KEEPALIVE_VALS'))
s = socket.socket() s = socket.socket()
self.addCleanup(s.close)
self.assertRaises(ValueError, s.ioctl, -1, None) self.assertRaises(ValueError, s.ioctl, -1, None)
s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100)) s.ioctl(socket.SIO_KEEPALIVE_VALS, (1, 100, 100))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment