enhance docs for empty_parameter_set_mark according to review comments
This commit is contained in:
parent
d550c33cd0
commit
77de45cce3
|
@ -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.
|
|
@ -350,17 +350,23 @@ passed multiple times. The expected format is ``name=value``. For example::
|
||||||
|
|
||||||
.. confval:: empty_parameter_set_mark
|
.. 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
|
* ``skip`` skips tests with a empty parameterset (default)
|
||||||
* ``xfail`` marks tests with a empty parameterset as xfail(run=False)
|
* ``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
|
# content of pytest.ini
|
||||||
[pytest]
|
[pytest]
|
||||||
empty_parameter_set_mark = xfail
|
empty_parameter_set_mark = xfail
|
||||||
|
|
||||||
|
|
||||||
|
.. _`#3155`: https://github.com/pytest-dev/pytest/issues/3155
|
Loading…
Reference in New Issue