Pytest plugin to validate use of envvars on your tests
Project description
Pytest plugin to validate use of envvars on your tests
What is pytest-envvars?
pytest-envvars randomize values of environment variables on your unit tests to check consistency of mocks about configuration. If the test has a wrong mock, this test will be broken.
Install
$ pip install pytest-envvars
Use
You need write some changes on pytest.ini file, like that…
[pytest]
pytestenvvars__env_files =
.env
pytestenvvars__dont_randomize_envvars =
CACHE_URL
On this example above the plugin read .env file (from pytestenvvars__env_files section) of your project and randomize ALL envvar configuration on that file, if you dont need randomize some envvar configuration you need add this envvar to pytestenvvars__dont_randomize_envvars section like shown above.
Before that configuration to run validation you need run pytest with flag --validate-envvars, like that…
pytest --validate-envvars
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_envvars-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f067aa8370468b5f00ef5bbc4035ced3ad1720c4091f3c971978170086959382 |
|
MD5 | 06dbd6148c911cbdc096b3c4afcba5bd |
|
BLAKE2b-256 | 2c1f4076858f0ffd930fe78acb060cefdb252bd4613d69d5b2b48024ac1d7bfb |