pypa/pip — pull request #576 by qwcode (2012-06-13 05:42:16+00:00)
Title: --user fixes part5:  reset_env option for adding patches to sitecustomize

part 5 of the pull #511 breakup
https://gist.github.com/2822510

part 5 is new in the plan as of today.

in writing tests for the *next* part, I was needing support for adding a monkey patch snippet to sitecustomize.py

this change adds an option to reset_env to allow any test to add a python code snippet to sitecustomize.py.

if you recall from part1, PyPIProxy.setup (which applies a monkey patch to urlopen) was moved to sitecustomize.py. the method that places that code was refactored to make use of this new general method.

the tests I wrote for this should make clear what this is about.