Skip to content

Commit 3fd2f43

Browse files
authored
Merge pull request #4828 from Zac-HD/mark-docs
Clarify docs on --strict marks
2 parents f494eef + d9bdf5c commit 3fd2f43

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

doc/en/mark.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ which also serve as documentation.
2929
Raising errors on unknown marks: --strict
3030
-----------------------------------------
3131

32-
When the ``--strict`` command-line flag is passed, any marks not registered in the ``pytest.ini`` file will trigger an error.
32+
When the ``--strict`` command-line flag is passed, any unknown marks applied
33+
with the ``@pytest.mark.name_of_the_mark`` decorator will trigger an error.
34+
Marks defined or added by pytest or by a plugin will not trigger an error.
3335

34-
Marks can be registered like this:
36+
Marks can be registered in ``pytest.ini`` like this:
3537

3638
.. code-block:: ini
3739

doc/en/reference.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,11 @@ passed multiple times. The expected format is ``name=value``. For example::
12261226

12271227
.. confval:: markers
12281228

1229-
List of markers that are allowed in test functions, enforced when ``--strict`` command-line argument is used.
1230-
You can use a marker name per line, indented from the option name.
1229+
When the ``--strict`` command-line argument is used, only known markers -
1230+
defined in code by core pytest or some plugin - are allowed.
1231+
You can list additional markers in this setting to add them to the whitelist.
1232+
1233+
You can list one marker name per line, indented from the option name.
12311234

12321235
.. code-block:: ini
12331236

0 commit comments

Comments
 (0)