You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a py.test plugin that enables you to set environment variables in the pytest.ini file.
5
4
6
-
Installation
7
-
------------
5
+
## Installation
8
6
9
-
Install with pip::
7
+
Install with pip:
10
8
11
9
pip install pytest-env
12
10
13
-
Uninstall with pip::
11
+
Uninstall with pip:
14
12
15
13
pip uninstall pytest-env
16
14
17
-
Usage
18
-
-----
15
+
## Usage
19
16
20
-
In your pytest.ini file add a key value pair with `env` as the key and the environment variables as a line
21
-
separated list of `KEY=VALUE` entries. The defined variables will be added to the environment before any tests are run:
17
+
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:
22
18
23
19
[pytest]
24
-
env =
20
+
env =
25
21
HOME=~/tmp
26
22
RUN_ENV=test
27
23
28
24
You can use `D:` (default) as prefix if you don't want to override existing environment variables:
29
25
30
-
31
26
[pytest]
32
-
env =
27
+
env =
33
28
D:HOME=~/tmp
34
29
D:RUN_ENV=test
35
30
31
+
Lastly, you can use existing environment variables using a python-like format:
0 commit comments