Clarifiyng documentation for parameterize

- Added snippet dealing with parameterize run order of tests
This commit is contained in:
Austin 2017-12-16 08:25:02 -06:00
parent db4df5833a
commit c90e76c371
1 changed files with 16 additions and 0 deletions

View File

@ -126,6 +126,22 @@ To get all combinations of multiple parametrized arguments you can stack
This will run the test with the arguments set to ``x=0/y=2``, ``x=0/y=3``, ``x=1/y=2`` and
``x=1/y=3``.
Due to how decorators work it runs in reverse of expected order.
In this case::
$ pytest
=========================== test session starts ============================
platform linux -- Python 3.x.y, pytest-3.x.y, py-1.x.y, pluggy-0.x.y
rootdir: $REGENDOC_TMPDIR, inifile:
collected 4 items
test.py::test_foo[2-0] PASSED [ 25%]
test.py::test_foo[2-1] PASSED [ 50%]
test.py::test_foo[3-0] PASSED [ 75%]
test.py::test_foo[3-1] PASSED [100%]
========================== 4 passed in 0.01 seconds ========================
.. _`pytest_generate_tests`:
Basic ``pytest_generate_tests`` example