[Python-checkins] cpython: Silence the altered state warning about threadgs when running test_httplib.
brett.cannon
python-checkins at python.org
Fri Aug 5 07:44:28 CEST 2011
http://hg.python.org/cpython/rev/210d9a2dab09
changeset: 71745:210d9a2dab09
user: Brett Cannon <brett at python.org>
date: Thu Aug 04 22:43:11 2011 -0700
summary:
Silence the altered state warning about threadgs when running test_httplib.
files:
Lib/test/test_httplib.py | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -506,8 +506,7 @@
def test_local_good_hostname(self):
# The (valid) cert validates the HTTP hostname
import ssl
- from test.ssl_servers import make_https_server
- server = make_https_server(self, CERT_localhost)
+ server = self.make_server(CERT_localhost)
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
context.verify_mode = ssl.CERT_REQUIRED
context.load_verify_locations(CERT_localhost)
@@ -515,12 +514,12 @@
h.request('GET', '/nonexistent')
resp = h.getresponse()
self.assertEqual(resp.status, 404)
+ del server
def test_local_bad_hostname(self):
# The (valid) cert doesn't validate the HTTP hostname
import ssl
- from test.ssl_servers import make_https_server
- server = make_https_server(self, CERT_fakehostname)
+ server = self.make_server(CERT_fakehostname)
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
context.verify_mode = ssl.CERT_REQUIRED
context.load_verify_locations(CERT_fakehostname)
@@ -538,6 +537,7 @@
h.request('GET', '/nonexistent')
resp = h.getresponse()
self.assertEqual(resp.status, 404)
+ del server
class RequestBodyTest(TestCase):
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list