pypa/pip — pull request #1147 by dstufft (2013-08-18 13:59:16+00:00)
Title: Switch to py.test and better isolate the tests (Part 1 of Many)

* Switches from nose to py.test
* Better output with the bare ``assert``s that we use throughout the tests
* Easy to use Distributed/Parallelized tests
* Fixture functions are awesome
* Creates Fixture for ``virtualenv``
* Creates an isolated virtualenv for each test
* Installs the in development pip inside the isolated env
* Creates Fixture for ``script``
* Really just a specialized instance of ``scripttest.TestFileEnviornment``
* Uses the ``virtualenv`` fixture to run inside of the test specific virtual env
* Ensures there are no temporary files left by default
* Rewrites tests/functional/test_bundle.py to use fixtures
* Rewrites tests/functional/test_completion.py to use fixtures

If this PR goes through I will end up sending more to rewrite the other test functions. The major motivation for this PR is to make our tests way better to run. Currently it gives some minor speed ups (a few seconds on the two files I converted) however the real power lies in the easy isolation. The converted tests no longer use a static directory for their work area nor do they use a global ``env`` module. This means that using a plugin like ``pytest-xdist`` we can easily parallelize the tests. The two files I converted the tests take ~14s to complete, but if I spin up 4 processes they take ~8s to complete.

A further goal is to enable removing the dependence on outside networks in our tests. This PR doesn't address that but it will be fairly easy to create a fake web server that get's spun up in the background and the tests can use as an index server. This will allow us to test pip without hitting the network and without removing all the http tests and replacing them with local file tests.

I've only converted two functions because I wanted to get opinions on this effort before spending the time rewriting more modules and also to make it easier to review the work that has happened.