pypa/pip — pull request #1157 by dstufft (2013-08-22 02:26:19+00:00)
Title: Refactor tests.lib.* to simplify and remove global state

* Slight refactor of ``tests.lib.path`` to clean up the implementation a bit and add a few new helper methods
* Removal of ``tests.lib.pypi_server``; future PRs will replace it with a local index server running as part of the test suite.
* Also remove the support code to handle monkeypatching
* Split virtualenv creation out of PipTestEnvironment
* Remove sitecustomize support, it's primary use was monkeypatching PyPICache, there was one or two uses inside the tests of it which got one off code to handle it.
* Removed a lot of unused helper functions or paths

This PR is a beat of a beast but the bulk of the actual logic changes exist inside of tests/lib/*, the rest of the changes are primarily switching from functions like ``run_pip`` which worked by using a global env and switching tests to call ``reset_env()`` to get their own reference to a env and then using methods on that env such as ``env.run()`` or ``env.pip()``.

This removes two speed enhancements; Using "pristine" virtualenv which simply gets copied back into place, and monkeypatching in a caching urllib2 that automatically caches PyPI. The first was removed because it depends on a shared virtual env location which prevents the eventual goal of isolated concurrent tests and the second was removed because it will not be needed once we have a local test index.