Close #19734: ignore pip env vars in ensurepip

This commit is contained in:
Nick Coghlan 2013-12-23 16:16:07 +10:00
parent 3f122d6f44
commit 6256fcbc97
4 changed files with 27 additions and 9 deletions

View file

@ -126,6 +126,14 @@ class TestBootstrap(unittest.TestCase):
ensurepip.bootstrap(altinstall=True, default_pip=True)
self.run_pip.assert_not_called()
def test_pip_environment_variables_removed(self):
# ensurepip deliberately ignores all pip environment variables
# See http://bugs.python.org/issue19734 for details
self.os_environ["PIP_THIS_SHOULD_GO_AWAY"] = "test fodder"
ensurepip.bootstrap()
self.assertNotIn("PIP_THIS_SHOULD_GO_AWAY", self.os_environ)
@contextlib.contextmanager
def fake_pip(version=ensurepip._PIP_VERSION):
if version is None: