Skip to main content

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

Project description

pytest-env

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.

Installation

Install with pip:

pip install pytest-env

Usage

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:

[pytest]
env =
    HOME=~/tmp
    RUN_ENV=test

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

[pytest]
env =
    D:HOME=~/tmp
    D:RUN_ENV=test

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

[pytest]
env =
    RUN_PATH=/run/path/{USER}

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file pytest_env-0.7.0.tar.gz.

File metadata

  • Download URL: pytest_env-0.7.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pytest_env-0.7.0.tar.gz
Algorithm Hash digest
SHA256 89b6a7a00174ee289029358364b37b688e964d2cb05a8b9e4514d4ab52b134bb
MD5 284feda1058c673aaafb224b3cd5c275
BLAKE2b-256 09eebf96c6f2994cc75eaede4ed0b934d43359debdbfaee364c1560a09cdf390

See more details on using hashes here.

File details

Details for the file pytest_env-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_env-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for pytest_env-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a11102037f91ab765390e6da684a99797ede08971f355eed53c7d1365d852467
MD5 fe00c3ae07247fa385076ba948113da1
BLAKE2b-256 b8a5d36f93fddb0a890050efc00f71e8149a70c38691709619299140a31e057c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page