summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-11-05 15:47:45 (GMT)
committerBrian Curtin <brian.curtin@gmail.com>2010-11-05 15:47:45 (GMT)
commit5ad0bd69c9b18e790074fc0643329383166d0eb5 (patch)
treeb2e6c4ba9debc9b023c90a17c68fd96a9f6e611e /Lib/test/test_socket.py
parent4841fd60fbb0c8148db5bbf066939658c355c77c (diff)
downloadcpython-5ad0bd69c9b18e790074fc0643329383166d0eb5.zip
cpython-5ad0bd69c9b18e790074fc0643329383166d0eb5.tar.gz
cpython-5ad0bd69c9b18e790074fc0643329383166d0eb5.tar.bz2
Add socket cleanup for ResourceWarning and update test to use skip decorator
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index facb065..57395b0 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -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))