summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-21 01:14:24 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-21 01:14:24 (GMT)
commit07627880813ffaad8d9b90bfe8791ccf588b031b (patch)
tree14fbe48b451085257da7c79781999cc86729c74f /Lib/test/test_socket.py
parent8cb253f8d6333af0a575d5951379c090752c0fc6 (diff)
downloadcpython-07627880813ffaad8d9b90bfe8791ccf588b031b.zip
cpython-07627880813ffaad8d9b90bfe8791ccf588b031b.tar.gz
cpython-07627880813ffaad8d9b90bfe8791ccf588b031b.tar.bz2
#7092 - Silence more py3k deprecation warnings, using test_support.check_py3k_warnings() helper.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 75bd258..f699e3c 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -123,8 +123,9 @@ class ThreadableTest:
self.server_ready.wait()
self.client_ready.set()
self.clientSetUp()
- if not callable(test_func):
- raise TypeError, "test_func must be a callable function"
+ with test_support.check_py3k_warnings():
+ if not callable(test_func):
+ raise TypeError("test_func must be a callable function.")
try:
test_func()
except Exception, strerror:
@@ -132,7 +133,7 @@ class ThreadableTest:
self.clientTearDown()
def clientSetUp(self):
- raise NotImplementedError, "clientSetUp must be implemented."
+ raise NotImplementedError("clientSetUp must be implemented.")
def clientTearDown(self):
self.done.set()
@@ -282,8 +283,8 @@ class GeneralModuleTests(unittest.TestCase):
orig = sys.getrefcount(__name__)
socket.getnameinfo(__name__,0)
except TypeError:
- if sys.getrefcount(__name__) <> orig:
- self.fail("socket.getnameinfo loses a reference")
+ self.assertEqual(sys.getrefcount(__name__), orig,
+ "socket.getnameinfo loses a reference")
def testInterpreterCrash(self):
# Making sure getnameinfo doesn't crash the interpreter
@@ -1234,7 +1235,8 @@ class BufferIOTest(SocketConnectedTest):
self.assertEqual(msg, MSG)
def _testRecvIntoArray(self):
- buf = buffer(MSG)
+ with test_support.check_py3k_warnings():
+ buf = buffer(MSG)
self.serv_conn.send(buf)
def testRecvIntoBytearray(self):
@@ -1263,7 +1265,8 @@ class BufferIOTest(SocketConnectedTest):
self.assertEqual(msg, MSG)
def _testRecvFromIntoArray(self):
- buf = buffer(MSG)
+ with test_support.check_py3k_warnings():
+ buf = buffer(MSG)
self.serv_conn.send(buf)
def testRecvFromIntoBytearray(self):