From c90e76c371c20ef27655334274add16fe3d34baf Mon Sep 17 00:00:00 2001 From: Austin Date: Sat, 16 Dec 2017 08:25:02 -0600 Subject: [PATCH] Clarifiyng documentation for parameterize - Added snippet dealing with parameterize run order of tests --- doc/en/parametrize.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/doc/en/parametrize.rst b/doc/en/parametrize.rst index 7a4ac2e18..b1d62d486 100644 --- a/doc/en/parametrize.rst +++ b/doc/en/parametrize.rst @@ -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