All Projects → rafaelhenrique → pytest-envvars

rafaelhenrique / pytest-envvars

Licence: MIT license
Pytest plugin to validate use of envvars on your tests

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to pytest-envvars

tfenv
Transform environment variables for use with Terraform (e.g. `HOSTNAME` ⇨ `TF_VAR_hostname`)
Stars: ✭ 120 (+471.43%)
Mutual labels:  environment-variables, environments, envvars
cypress-dotenv
Cypress plugin that enables compatability with dotenv
Stars: ✭ 47 (+123.81%)
Mutual labels:  environment-variables, envvars
envy
envy: Deserialize environment variables into type-safe structs
Stars: ✭ 64 (+204.76%)
Mutual labels:  environment-variables, envvars
ci-testing-python
Sample Microservice App in Python for Testing using pytest, uber/doubles, tox on CI servers like Jenkins and Travis CI using Docker + Docker-Compose for test environment.
Stars: ✭ 37 (+76.19%)
Mutual labels:  pytest
agent-python-pytest
Framework integration with PyTest
Stars: ✭ 86 (+309.52%)
Mutual labels:  pytest
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+847.62%)
Mutual labels:  pytest
pylint-pytest
A Pylint plugin to suppress pytest-related false positives.
Stars: ✭ 2 (-90.48%)
Mutual labels:  pytest
jsonargparse
Implement minimal boilerplate CLIs derived from type hints and parse from command line, config files and environment variables
Stars: ✭ 168 (+700%)
Mutual labels:  environment-variables
Konfig
Simple config properties API for Kotlin
Stars: ✭ 249 (+1085.71%)
Mutual labels:  environment-variables
pytest-neo
Matrix has you...
Stars: ✭ 44 (+109.52%)
Mutual labels:  pytest
envs
Easy access of environment variables from Python with support for typing (ex. booleans, strings, lists, tuples, integers, floats, and dicts). Now with CLI settings file converter.
Stars: ✭ 25 (+19.05%)
Mutual labels:  environment-variables
pytest-playwright
Pytest plugin to write Playwright tests with ease. Provides fixtures to have a page instance for each individual test and helpful CLI options for headless browsers.
Stars: ✭ 14 (-33.33%)
Mutual labels:  pytest
stock reminder bot
A twitter bot that reminds you of stock and crypto predictions
Stars: ✭ 25 (+19.05%)
Mutual labels:  pytest
Semantic-Textual-Similarity
Natural Language Processing using NLTK and Spacy
Stars: ✭ 30 (+42.86%)
Mutual labels:  pytest
dotenvy
Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents
Stars: ✭ 31 (+47.62%)
Mutual labels:  environment-variables
pytest-kind
Mirror of pytest-kind: Test your Python Kubernetes app/operator end-to-end with kind and pytest
Stars: ✭ 16 (-23.81%)
Mutual labels:  pytest
Go Env
a golang library to manage environment variables
Stars: ✭ 247 (+1076.19%)
Mutual labels:  environment-variables
envsafe
🔒 Makes sure you don't accidentally deploy apps with missing or invalid environment variables.
Stars: ✭ 705 (+3257.14%)
Mutual labels:  environment-variables
Management
Management Endpoints used to allow insight into your applications
Stars: ✭ 31 (+47.62%)
Mutual labels:  environment-variables
sitri
Sitri - powerful settings & configs for python
Stars: ✭ 20 (-4.76%)
Mutual labels:  environment-variables

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.

Before that configuration to run validation you need run pytest with flag --validate-envvars, like that...

pytest --validate-envvars

To debug purpose you can use --envvars-value to set a default value for all envvars. This parameter accept only two options 0 or 1, see this example:

pytest --validate-envvars --envvars-value=0

Using the plugin that way you will apply the value 0 to ALL of your envvars.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].