py.test plugin that allows you to add environment variables.
pytest-env
This is a pytest plugin that enables you to set environment variables in a pytest.ini or pyproject.toml 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
Or with pyproject.toml:
[tool.pytest.ini_options]
env = [
"HOME=~/tmp",
"RUN_ENV=test",
]
Only set if not already set
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
Transformation
You can use existing environment variables using a python-like format, these environment variables will be expended
before setting the environment variable:
[pytest]
env =
RUN_PATH=/run/path/{USER}
You can apply the R: prefix to keep the raw valu
- RPM
- python3-pytest-env-0.8.1-1.lbn36.noarch.rpm
- Summary
- py.test plugin that allows you to add environment variables.
- URL
- https://pypi.org/project/pytest-env
- Group
- Unspecified
- License
- ZPL
- Source
-
python-pytest-env-0.8.1-1.lbn36.src.rpm
- Checksum
- 20b94cdbcf5eea5ef5389f85d38bee856fee2d52a75c3dbf98d423e24559057c
- Build Date
- 2024/03/21 13:13:08
- Requires
-
python3.10dist(pytest) >= 7.1.3
- Provides
-
python-pytest-env = 0.8.1-1.lbn36
python3-pytest-env = 0.8.1-1.lbn36
python3.10-pytest-env = 0.8.1-1.lbn36
python3.10dist(pytest-env) = 0.8.1
python3dist(pytest-env) = 0.8.1
- Obsoletes