pytest-envvars:Pytest插件来验证测试中使用envvars

时间:2021-05-27 05:03:23
【文件属性】:
文件名称:pytest-envvars:Pytest插件来验证测试中使用envvars
文件大小:22KB
文件格式:ZIP
更新时间:2021-05-27 05:03:23
testing environment-variables pytest environments envvars pytest-envvars Pytest插件来验证测试中使用envvars 什么是pytest-envvars? pytest-envvars在单元测试中随机化环境变量的值,以检查有关配置的模拟的一致性。 如果测试模拟错误,则该测试将被破坏。 安装 $ pip install pytest-envvars 用 您需要在pytest.ini文件上写一些更改,像这样... [pytest] pytestenvvars__env_files = .env pytestenvvars__dont_randomize_envvars = CACHE_URL 在此示例的上方示例中,插件读取了项目的.env文件(来自pytestenvvars__env_files部分),并对该文件的所有envvar配置进行了随机化,如果您不需要随机化某些envvar配置,则需要将此环境添加到
【文件预览】:
pytest-envvars-master
----MANIFEST.in(137B)
----README.rst(2KB)
----AUTHORS.rst(251B)
----.travis.yml(851B)
----tox.ini(409B)
----LICENSE(1KB)
----pytest_envvars()
--------django_utils.py(6KB)
--------__init__.py(4KB)
----setup.cfg(63B)
----setup.py(2KB)
----CHANGES.rst(922B)
----Makefile(1KB)
----tests()
--------test_django_utils.py(5KB)
--------test_pytest_envvars.py(7KB)
--------test_django_application.py(1KB)
--------pytest_envvars_django_test()
--------conftest.py(2KB)
----.gitignore(1KB)

网友评论