Skip to main content

Pytest plugin to validate use of envvars on your tests

Project description

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.

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

pytest-envvars-1.0.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_envvars-1.0.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file pytest-envvars-1.0.0.tar.gz.

File metadata

  • Download URL: pytest-envvars-1.0.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for pytest-envvars-1.0.0.tar.gz
Algorithm Hash digest
SHA256 84cb0e74dbf53aa7411f135c8dbff2c9315665730f0a0f0900bc6b9d6aea398c
MD5 5929110b5b280071c47f743f438ec875
BLAKE2b-256 59aaac6f2654753597a1d37f46443a5306df9ceed14e7263cd383f6fd79a3a20

See more details on using hashes here.

File details

Details for the file pytest_envvars-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_envvars-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for pytest_envvars-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bc36d034b8a334c3c70dc7e80d16f379a3b740a49810d8ca6433cafc4761f66
MD5 2e1d663c116167dd3a60dc7392e08c7b
BLAKE2b-256 3bff2341696abc5157b48c9e80fae46cbec972a4fb49f167d74929d33acb1741

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page