summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ensurepip.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2014-02-28 13:35:05 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2014-02-28 13:35:05 (GMT)
commita46cf12e9956dbb0fa84cc1d7e8b81d4d2f7c55a (patch)
tree38fddc902f210fa79e212a302d9cc36938305edd /Lib/test/test_ensurepip.py
parent26dd0ff075bcfcdc6eebe584dce55dfd2f1b1537 (diff)
downloadcpython-a46cf12e9956dbb0fa84cc1d7e8b81d4d2f7c55a.zip
cpython-a46cf12e9956dbb0fa84cc1d7e8b81d4d2f7c55a.tar.gz
cpython-a46cf12e9956dbb0fa84cc1d7e8b81d4d2f7c55a.tar.bz2
Close #20757: return success for skipped pip uninstall
The 3.4rc2 Windows uninstaller would fail if pip had been updated to a version that didn't match the version installed by ensurepip. This skip is no longer treated as an error, so an updated pip ends up being handled like any other pip installed package and is left alone by the CPython uninstaller.
Diffstat (limited to 'Lib/test/test_ensurepip.py')
-rw-r--r--Lib/test/test_ensurepip.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py
index 8644a65..70b4153 100644
--- a/Lib/test/test_ensurepip.py
+++ b/Lib/test/test_ensurepip.py
@@ -196,10 +196,12 @@ class TestUninstall(EnsurepipMixin, unittest.TestCase):
ensurepip._uninstall_helper()
self.run_pip.assert_not_called()
- def test_uninstall_fails_with_wrong_version(self):
+ def test_uninstall_skipped_with_warning_for_wrong_version(self):
with fake_pip("not a valid version"):
- with self.assertRaises(RuntimeError):
+ with test.support.captured_stderr() as stderr:
ensurepip._uninstall_helper()
+ warning = stderr.getvalue().strip()
+ self.assertIn("only uninstall a matching version", warning)
self.run_pip.assert_not_called()