py.test fixture for creating a virtual environment
Project description
pytest-venv is a simple pytest plugin that exposes a venv fixture. The fixture is used to create a new virtual environment which can be used to install packages and run commands inside tests.
Usage
import os
def test_it(venv):
venv.install('pyramid', upgrade=True)
subprocess.check_call(
[os.path.join(venv.bin, 'pserve'), 'development.ini'],
)
API
The venv fixture is an instance of pytest_venv.VirtualEnvironment(path) which exposes the following API:
path
The path to the virtualenv directory.
bin
The path to the bin / Scripts directory.
python
The path to the python executable in the virtualenv.
create(system_site_packages=False)
Create a virtualenv. This is called automatically by the venv fixture.
install(pkg_name, editable=False, upgrade=False)
Use pip to install a package into the virtualenv. pkg_name may be a path to a package on disk.
0.1.1 (2016-11-27)
Ensure the virtual environment is started with the same Python executable as the current process.
0.1 (2016-11-27)
Initial release.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pytest_venv-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 111bfb3726523b7436b62c18cd2a6c263f08479d0ff41488d5870a296a8c0961 |
|
MD5 | b7c7f5b2475f124659cef1c01d4d5117 |
|
BLAKE2b-256 | 8b8eb798efde67f20d498ad3332a8bfba7361742dc10da4321b0591a5107a571 |