mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref tests.
This commit is contained in:
commit
d3e1207191
8 changed files with 27 additions and 26 deletions
|
@ -1001,7 +1001,7 @@ class TestTimeouts(TestCase):
|
|||
|
||||
def testTimeoutDefault(self):
|
||||
# default -- use global socket timeout
|
||||
self.assertTrue(socket.getdefaulttimeout() is None)
|
||||
self.assertIsNone(socket.getdefaulttimeout())
|
||||
socket.setdefaulttimeout(30)
|
||||
try:
|
||||
ftp = ftplib.FTP(HOST)
|
||||
|
@ -1013,13 +1013,13 @@ class TestTimeouts(TestCase):
|
|||
|
||||
def testTimeoutNone(self):
|
||||
# no timeout -- do not use global socket timeout
|
||||
self.assertTrue(socket.getdefaulttimeout() is None)
|
||||
self.assertIsNone(socket.getdefaulttimeout())
|
||||
socket.setdefaulttimeout(30)
|
||||
try:
|
||||
ftp = ftplib.FTP(HOST, timeout=None)
|
||||
finally:
|
||||
socket.setdefaulttimeout(None)
|
||||
self.assertTrue(ftp.sock.gettimeout() is None)
|
||||
self.assertIsNone(ftp.sock.gettimeout())
|
||||
self.evt.wait()
|
||||
ftp.close()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue