[issue26757] test_urllib2net.test_http_basic() timeout after 15 min on

STINNER Victor report at bugs.python.org
Thu Apr 14 10:57:01 EDT 2016


STINNER Victor added the comment:

It looks deliberate to test the HTTP query with *no* timeout. Sadly, it looks like it's ok that an HTTP query takes longer than 15 minutes!

Can't we mock the query to only test that the socket timeout is None? Move the test from test_urllib2net to test_urllib2.

class TimeoutTest(unittest.TestCase):
    def test_http_basic(self):
        self.assertIsNone(socket.getdefaulttimeout())
        url = "http://www.example.com"
        with support.transient_internet(url, timeout=None):
            u = _urlopen_with_retry(url)
            self.addCleanup(u.close)
            self.assertIsNone(u.fp.raw._sock.gettimeout())

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26757>
_______________________________________


More information about the Python-bugs-list mailing list