enhance docs for empty_parameter_set_mark according to review comments

This commit is contained in:
Ronny Pfannschmidt 2018-01-26 12:01:27 +01:00
parent d550c33cd0
commit 77de45cce3
2 changed files with 14 additions and 8 deletions

View File

@ -1 +1 @@
introduce a pytest ini option to pick the mark for empty parametersets and allow to use xfail(run=False)
Introduce ``empty_parameter_set_mark`` ini option to select which mark to apply when ``@pytest.mark.parametrize`` is given an empty set of parameters. Valid options are ``skip`` (default) and ``xfail``. Note that it is planned to change the default to ``xfail`` in future releases as this is considered less error prone.

View File

@ -350,17 +350,23 @@ passed multiple times. The expected format is ``name=value``. For example::
.. confval:: empty_parameter_set_mark
.. versionadded:: 3.4
.. versionadded:: 3.4
allows to pick the action for empty parametersets in parameterization
Allows to pick the action for empty parametersets in parameterization
* ``skip`` skips tests with a empty parameterset
* ``xfail`` marks tests with a empty parameterset as xfail(run=False)
* ``skip`` skips tests with a empty parameterset (default)
* ``xfail`` marks tests with a empty parameterset as xfail(run=False)
The default is ``skip``, it will be shifted to xfail in future.
.. note::
.. code-block:: ini
it is planned to change the default to ``xfail`` in future releases
as this is considered less error prone. see `#3155`_
.. code-block:: ini
# content of pytest.ini
[pytest]
empty_parameter_set_mark = xfail
empty_parameter_set_mark = xfail
.. _`#3155`: https://github.com/pytest-dev/pytest/issues/3155