How about using distutils_install_for_testing?