Skip to content

Commit

Permalink
Change --strict help message to clarify it deals with unregistered ma…
Browse files Browse the repository at this point in the history
…rkers

Fix pytest-dev#2444
  • Loading branch information
nicoddemus committed Jul 4, 2017
1 parent b63f677 commit 221f42c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _pytest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def pytest_addoption(parser):
action="store", type=int, dest="maxfail", default=0,
help="exit after first num failures or errors.")
group._addoption('--strict', action="store_true",
help="run pytest in strict mode, warnings become errors.")
help="marks not registered in configuration file raise errors.")
group._addoption("-c", metavar="file", type=str, dest="inifilename",
help="load configuration from `file` instead of trying to locate one of the implicit configuration files.")
group._addoption("--continue-on-collection-errors", action="store_true",
Expand Down
1 change: 1 addition & 0 deletions changelog/2444.trivial
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update help message for ``--strict`` to make it clear it only deals with unregistered markers, not warnings.
9 changes: 4 additions & 5 deletions doc/en/example/markers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,12 @@ For an example on how to add and work with markers from a plugin, see

It is recommended to explicitly register markers so that:

* there is one place in your test suite defining your markers
* There is one place in your test suite defining your markers

* asking for existing markers via ``pytest --markers`` gives good output
* Asking for existing markers via ``pytest --markers`` gives good output

* typos in function markers are treated as an error if you use
the ``--strict`` option. Future versions of ``pytest`` are probably
going to start treating non-registered markers as errors at some point.
* Typos in function markers are treated as an error if you use
the ``--strict`` option.

.. _`scoped-marking`:

Expand Down
2 changes: 1 addition & 1 deletion testing/test_skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_strict_and_skip(self, testdir):
def test_hello():
pass
""")
result = testdir.runpytest("-rs --strict")
result = testdir.runpytest("-rs")
result.stdout.fnmatch_lines([
"*unconditional skip*",
"*1 skipped*",
Expand Down

0 comments on commit 221f42c

Please sign in to comment.