From d9bdf5cfcad9510559eda6c3a4c5a1eb060b53e8 Mon Sep 17 00:00:00 2001 From: Zac-HD Date: Mon, 25 Feb 2019 22:30:49 +1100 Subject: [PATCH] Clarify docs on --strict marks --- doc/en/mark.rst | 6 ++++-- doc/en/reference.rst | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/en/mark.rst b/doc/en/mark.rst index d5c5c5735..e841a6780 100644 --- a/doc/en/mark.rst +++ b/doc/en/mark.rst @@ -29,9 +29,11 @@ which also serve as documentation. Raising errors on unknown marks: --strict ----------------------------------------- -When the ``--strict`` command-line flag is passed, any marks not registered in the ``pytest.ini`` file will trigger an error. +When the ``--strict`` command-line flag is passed, any unknown marks applied +with the ``@pytest.mark.name_of_the_mark`` decorator will trigger an error. +Marks defined or added by pytest or by a plugin will not trigger an error. -Marks can be registered like this: +Marks can be registered in ``pytest.ini`` like this: .. code-block:: ini diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 24d5f7975..1ed5d91b1 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -1226,8 +1226,11 @@ passed multiple times. The expected format is ``name=value``. For example:: .. confval:: markers - List of markers that are allowed in test functions, enforced when ``--strict`` command-line argument is used. - You can use a marker name per line, indented from the option name. + When the ``--strict`` command-line argument is used, only known markers - + defined in code by core pytest or some plugin - are allowed. + You can list additional markers in this setting to add them to the whitelist. + + You can list one marker name per line, indented from the option name. .. code-block:: ini