summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2016-08-03 16:48:11 -0400
committerBruno Oliveira <nicoddemus@gmail.com>2016-08-03 16:48:11 -0400
commitd28801d79498b9e1b27693597e74395476ca1629 (patch)
tree35c7ceaa38b6f1f1de2424ff6688ce14c651ae61 /doc
parent72df32f1fd106e642114b2aee8ba1820ab5f82ec (diff)
downloadpytest-d28801d79498b9e1b27693597e74395476ca1629.tar.gz
Make parametrize example deterministic
Diffstat (limited to 'doc')
-rw-r--r--doc/en/example/parametrize.rst9
1 files changed, 4 insertions, 5 deletions
diff --git a/doc/en/example/parametrize.rst b/doc/en/example/parametrize.rst
index 197a54263..06d6ae767 100644
--- a/doc/en/example/parametrize.rst
+++ b/doc/en/example/parametrize.rst
@@ -346,7 +346,7 @@ parametrizer`_ but in a lot less code::
def pytest_generate_tests(metafunc):
# called once per each test function
funcarglist = metafunc.cls.params[metafunc.function.__name__]
- argnames = list(funcarglist[0])
+ argnames = sorted(funcarglist[0])
metafunc.parametrize(argnames, [[funcargs[name] for name in argnames]
for funcargs in funcarglist])
@@ -397,11 +397,10 @@ is to be run with different sets of arguments for its three arguments:
Running it results in some skips if we don't have all the python interpreters installed and otherwise runs all combinations (5 interpreters times 5 interpreters times 3 objects to serialize/deserialize)::
. $ pytest -rs -q multipython.py
- ssssssssssss...ssssssssssss
+ sssssssssssssss.........sss.........sss.........
======= short test summary info ========
- SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:23: 'python2.6' not found
- SKIP [12] $REGENDOC_TMPDIR/CWD/multipython.py:23: 'python3.3' not found
- 3 passed, 24 skipped in 0.12 seconds
+ SKIP [21] $REGENDOC_TMPDIR/CWD/multipython.py:23: 'python2.6' not found
+ 27 passed, 21 skipped in 0.12 seconds
Indirect parametrization of optional implementations/imports
--------------------------------------------------------------------