From fe2c9e4292699635c91174bc049aefe81bf6116c Mon Sep 17 00:00:00 2001 From: Paul Ganssle Date: Wed, 7 Nov 2018 17:07:58 -0500 Subject: Fix show_response behavior on Python 2 The `upload.show_response` feature was not added until Python 3. Rather than backport it, it is now enabled only if supported. This also adds a "smoke test" for the feature. --- setuptools/tests/test_upload.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'setuptools/tests/test_upload.py') diff --git a/setuptools/tests/test_upload.py b/setuptools/tests/test_upload.py index 7bf8e312..319ed7a2 100644 --- a/setuptools/tests/test_upload.py +++ b/setuptools/tests/test_upload.py @@ -223,3 +223,12 @@ class TestUploadTest: assert entries['comment'].startswith(u'built for') assert len(entries['comment']) > len(u'built for') + def test_show_response_no_error(self, patched_upload): + # This test is just that show_response doesn't throw an error + # It is not really important what the printed response looks like + # in a deprecated command, but we don't want to introduce new + # errors when importing this function from distutils + + patched_upload.cmd.show_response = True + patched_upload.cmd.ensure_finalized() + patched_upload.cmd.run() -- cgit v1.2.3