diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-04-19 04:23:09 +0300 |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-04-19 04:23:09 +0300 |
| commit | 036968d741e319006ddfcbeb48d5a22f5da574dc (patch) | |
| tree | 072e6b53f5853a047b9217500ab175ac2b55445d /tests/test_upload.py | |
| parent | 8d4894ed4c00a8db7d896ec793c766c86c58d586 (diff) | |
| download | python-setuptools-git-036968d741e319006ddfcbeb48d5a22f5da574dc.tar.gz | |
Fix uploadTestCase to work even when HTTPSConnection is not available.
Diffstat (limited to 'tests/test_upload.py')
| -rw-r--r-- | tests/test_upload.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_upload.py b/tests/test_upload.py index d2696866..4a71ca4a 100644 --- a/tests/test_upload.py +++ b/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 |
