diff options
author | Facundo Batista <facundobatista@gmail.com> | 2007-03-25 03:20:05 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2007-03-25 03:20:05 (GMT) |
commit | f196629eba4c663827bf259dae95929aaaf7455b (patch) | |
tree | c424f11d021e2dae0f1aafeff0f9781a3c09c8ef | |
parent | b8af7bcad55b00234766662aa13032af22906963 (diff) | |
download | cpython-f196629eba4c663827bf259dae95929aaaf7455b.zip cpython-f196629eba4c663827bf259dae95929aaaf7455b.tar.gz cpython-f196629eba4c663827bf259dae95929aaaf7455b.tar.bz2 |
Closing the HTTP connection after each test, and listening more.
-rw-r--r-- | Lib/test/test_httplib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 78aa651..c1ec4a0 100644 --- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -160,7 +160,7 @@ class TimeoutTest(TestCase): self.serv.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) global PORT PORT = test_support.bind_port(self.serv, HOST, PORT) - self.serv.listen(1) + self.serv.listen(5) def tearDown(self): self.serv.close() @@ -174,11 +174,13 @@ class TimeoutTest(TestCase): httpConn = httplib.HTTPConnection(HOST, PORT) httpConn.connect() self.assertTrue(httpConn.sock.gettimeout() is None) + httpConn.close() # a value httpConn = httplib.HTTPConnection(HOST, PORT, timeout=30) httpConn.connect() self.assertEqual(httpConn.sock.gettimeout(), 30) + httpConn.close() # None, having other default previous = socket.getdefaulttimeout() @@ -189,6 +191,7 @@ class TimeoutTest(TestCase): finally: socket.setdefaulttimeout(previous) self.assertEqual(httpConn.sock.gettimeout(), 30) + httpConn.close() def test_main(verbose=None): |