Commit 036968d7 authored by Ezio Melotti's avatar Ezio Melotti

Fix uploadTestCase to work even when HTTPSConnection is not available.

parent 8d4894ed
......@@ -72,13 +72,13 @@ class uploadTestCase(PyPIRCCommandTestCase):
def setUp(self):
super(uploadTestCase, self).setUp()
self.old_class = httpclient.HTTPSConnection
if hasattr(httpclient, 'HTTPSConnection'):
self.addCleanup(setattr, httpclient, 'HTTPSConnection',
httpclient.HTTPSConnection)
else:
self.addCleanup(delattr, httpclient, 'HTTPSConnection')
self.conn = httpclient.HTTPSConnection = FakeConnection()
def tearDown(self):
httpclient.HTTPSConnection = self.old_class
super(uploadTestCase, self).tearDown()
def test_finalize_options(self):
# new format
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment