Add documentation blurb for --strict

Fix #3549
This commit is contained in:
Bruno Oliveira 2018-06-09 11:59:02 -03:00
parent 55bbd3e3e2
commit 97d48ba60d
2 changed files with 25 additions and 0 deletions

1
changelog/3549.doc.rst Normal file
View File

@ -0,0 +1 @@
Add documentation for the ``--strict`` flag.

View File

@ -26,6 +26,30 @@ which also serve as documentation.
:ref:`fixtures <fixtures>`.
Raising errors on unknown marks: --strict
-----------------------------------------
The ``--strict`` command-line flag can be used to raise errors when marks not registered in the ``pytest.ini`` file.
Marks can be registered like this:
.. code-block:: ini
[pytest]
markers =
slow
serial
This can be used to prevent users mistyping mark names by accident. Test suites that want to enforce that this
should add ``--strict`` to ``addopts``:
.. code-block:: ini
[pytest]
addopts = --strict
markers =
slow
serial
.. currentmodule:: _pytest.mark.structures
.. autoclass:: Mark
:members: