Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/en/mark.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions doc/en/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down