mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Fix uploadTestCase to work even when HTTPSConnection is not available.
This commit is contained in:
parent
72b8502992
commit
f7520dc0d7
1 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue