mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix test_socket broken in previous commit (changeset 13e2e44db99d).
Added new checks for socket.setblocking().
This commit is contained in:
parent
df20b51dff
commit
45cb7f6529
1 changed files with 7 additions and 5 deletions
|
@ -3566,7 +3566,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
|
||||||
|
|
||||||
def testSetBlocking(self):
|
def testSetBlocking(self):
|
||||||
# Testing whether set blocking works
|
# Testing whether set blocking works
|
||||||
self.serv.setblocking(0)
|
self.serv.setblocking(True)
|
||||||
|
self.assertIsNone(self.serv.gettimeout())
|
||||||
|
self.serv.setblocking(False)
|
||||||
|
self.assertEqual(self.serv.gettimeout(), 0.0)
|
||||||
start = time.time()
|
start = time.time()
|
||||||
try:
|
try:
|
||||||
self.serv.accept()
|
self.serv.accept()
|
||||||
|
@ -3575,10 +3578,9 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
|
||||||
end = time.time()
|
end = time.time()
|
||||||
self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.")
|
self.assertTrue((end - start) < 1.0, "Error setting non-blocking mode.")
|
||||||
# Issue 15989
|
# Issue 15989
|
||||||
self.assertRaises(OverflowError, self.serv.setblocking,
|
if _testcapi.UINT_MAX < _testcapi.ULONG_MAX:
|
||||||
_testcapi.INT_MAX + 1)
|
self.serv.setblocking(_testcapi.UINT_MAX + 1)
|
||||||
self.assertRaises(OverflowError, self.serv.setblocking,
|
self.assertIsNone(self.serv.gettimeout())
|
||||||
_testcapi.UINT_MAX + 1)
|
|
||||||
|
|
||||||
def _testSetBlocking(self):
|
def _testSetBlocking(self):
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue