diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-04-19 01:23:09 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-04-19 01:23:09 (GMT) |
commit | f7520dc0d7b4965f2c23a734ab48d472553d3b06 (patch) | |
tree | 79523e3eac81cabea294eabcf14cda716ca1d6d4 /Lib/distutils/tests/test_upload.py | |
parent | 72b8502992d3ee282e46231a953852c6a78fb000 (diff) | |
download | cpython-f7520dc0d7b4965f2c23a734ab48d472553d3b06.zip cpython-f7520dc0d7b4965f2c23a734ab48d472553d3b06.tar.gz cpython-f7520dc0d7b4965f2c23a734ab48d472553d3b06.tar.bz2 |
Fix uploadTestCase to work even when HTTPSConnection is not available.
Diffstat (limited to 'Lib/distutils/tests/test_upload.py')
-rw-r--r-- | Lib/distutils/tests/test_upload.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/distutils/tests/test_upload.py b/Lib/distutils/tests/test_upload.py index d269686..4a71ca4 100644 --- a/Lib/distutils/tests/test_upload.py +++ b/Lib/distutils/tests/test_upload.py @@ -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 |