The problem seems to be in tests/test_datafiles_install.py which tries to execute a bare pip install .
A somewhat easy workaround would be to set up a temporary directory and export PIP_TARGET=/path/to/tmp/staging before running each test that tries to pip install.
UPDATE: Also seems to affect tests/test_install.py.