Skip to main content

py.test plugin that allows you to add environment variables.

Project description


PyPI Supported Python versions check Code style: black Downloads

This is a py.test plugin that enables you to set environment variables in the pytest.ini file.


Install with pip:

pip install pytest-env


In your pytest.ini file add a key value pair with env as the key and the environment variables as a line separated list of KEY=VALUE entries. The defined variables will be added to the environment before any tests are run:

env =

You can use D: (default) as prefix if you don't want to override existing environment variables:

env =

Lastly, you can use existing environment variables using a python-like format:

env =

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

pytest_env-0.7.0.tar.gz (6.0 kB view hashes)

Uploaded source

Built Distribution

pytest_env-0.7.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page