diff --git a/changelog/2527.feature b/changelog/2527.feature index 97e2a63fb..ed00398d9 100644 --- a/changelog/2527.feature +++ b/changelog/2527.feature @@ -1 +1 @@ -introduce a pytest ini option to pick the mark for empty parametersets and allow to use xfail(run=False) \ No newline at end of file +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. \ No newline at end of file diff --git a/doc/en/customize.rst b/doc/en/customize.rst index eb79ba668..80efe6b83 100644 --- a/doc/en/customize.rst +++ b/doc/en/customize.rst @@ -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 \ No newline at end of file + empty_parameter_set_mark = xfail + + +.. _`#3155`: https://github.com/pytest-dev/pytest/issues/3155 \ No newline at end of file