Merge pull request #4220 from anpr/doc_raise_on_empty_parameterset

Add `empty_parameter_set_mark` ini option documentation to the parametrize doc
This commit is contained in:
Bruno Oliveira 2018-10-23 19:10:44 -03:00 committed by GitHub
commit 8bced7415c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog/3851.doc.rst Normal file
View File

@ -0,0 +1 @@
Add reference to ``empty_parameter_set_mark`` ini option in documentation of ``@pytest.mark.parametrize``

View File

@ -114,6 +114,10 @@ Let's run this::
The one parameter set which caused a failure previously now The one parameter set which caused a failure previously now
shows up as an "xfailed (expected to fail)" test. shows up as an "xfailed (expected to fail)" test.
In case the values provided to ``parametrize`` result in an empty list - for
example, if they're dynamically generated by some function - the behaviour of
pytest is defined by the :confval:`empty_parameter_set_mark` option.
To get all combinations of multiple parametrized arguments you can stack To get all combinations of multiple parametrized arguments you can stack
``parametrize`` decorators:: ``parametrize`` decorators::