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.
This commit is contained in:
Nick Coghlan 2014-02-28 23:35:05 +10:00
parent 26dd0ff075
commit a46cf12e99
3 changed files with 21 additions and 4 deletions

View file

@ -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()