[Python-checkins] r86206 - in python/branches/release27-maint: Lib/test/test_socket.py

brian.curtin python-checkins at python.org
Fri Nov 5 16:52:20 CET 2010


Author: brian.curtin
Date: Fri Nov  5 16:52:20 2010
New Revision: 86206

Log:
Merged revisions 86205 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r86205 | brian.curtin | 2010-11-05 10:47:45 -0500 (Fri, 05 Nov 2010) | 2 lines
  
  Add socket cleanup for ResourceWarning and update test to use skip decorator
........


Modified:
   python/branches/release27-maint/   (props changed)
   python/branches/release27-maint/Lib/test/test_socket.py

Modified: python/branches/release27-maint/Lib/test/test_socket.py
==============================================================================
--- python/branches/release27-maint/Lib/test/test_socket.py	(original)
+++ python/branches/release27-maint/Lib/test/test_socket.py	Fri Nov  5 16:52:20 2010
@@ -571,15 +571,15 @@
         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))
 


More information about the Python-checkins mailing list