jfunez / pytest-envvars

Pytest plugin to validate use of envvars on your tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pytest-envvars

See Build Status on Travis CI

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.

About

Pytest plugin to validate use of envvars on your tests

License:MIT License


Languages

Language:Python 93.8%Language:Makefile 4.4%Language:HTML 1.8%