This is a simple plugin for pytest that allows you to create a virtual environment inside the tests.
pip install pytest-pyvenv
pip install git+https://github.com/msinamsina/pytest-pyvenv.git
def test_env(pyvenv):
pyvenv.install_package('pytest-pyvenv')
pyvenv.run('mkdir -p tests')
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.