Merge pull request #3558 from nicoddemus/doc-strict

Add documentation blurb for --strict
This commit is contained in:
Bruno Oliveira 2018-06-09 19:38:31 -03:00 committed by GitHub
commit 7c8d072241
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 4 deletions

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

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

View File

@ -26,10 +26,30 @@ which also serve as documentation.
:ref:`fixtures <fixtures>`. :ref:`fixtures <fixtures>`.
.. currentmodule:: _pytest.mark.structures Raising errors on unknown marks: --strict
.. autoclass:: Mark -----------------------------------------
:members:
:noindex: When the ``--strict`` command-line flag is passed, any marks not registered in the ``pytest.ini`` file will trigger an error.
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 this
should add ``--strict`` to ``addopts``:
.. code-block:: ini
[pytest]
addopts = --strict
markers =
slow
serial
.. `marker-iteration` .. `marker-iteration`