demo showing pytest parametrize used with Django waffle
app | ||
demo | ||
.gitignore | ||
manage.py | ||
pytest.ini | ||
Readme.md | ||
requirements.txt |
pytest parametrize demo
Use parametrize with Django waffle. See blog post (TBD)
Output
(venv) timo@dev:~/blog/parametrize$ pytest
=============================================================================================== test session starts ================================================================================================
platform linux -- Python 3.9.2, pytest-7.4.4, pluggy-1.4.0
django: version: 4.2.9, settings: demo.settings (from ini)
rootdir: /home/timo/blog/parametrize
configfile: pytest.ini
plugins: django-4.7.0
collected 5 items
app/tests.py::test_complex_function[True]
-------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------
INFO app_tests:code.py:24 rewrite complex
PASSED [ 20%]
app/tests.py::test_complex_function[False]
-------------------------------------------------------------------------------------------------- live log call ---------------------------------------------------------------------------------------------------
INFO app_tests:code.py:29 deprecated complex
PASSED [ 40%]
app/tests.py::test_simple[foo bar] PASSED [ 60%]
app/tests.py::test_simple[baz zab] PASSED [ 80%]
app/tests.py::test_simple[1 2 3 4 5] PASSED [100%]
================================================================================================ 5 passed in 0.21s =================================================================================================