Merge pull request #2552 from nicoddemus/strict-help-message

Change --strict help message to clarify it deals with unregistered markers
This commit is contained in:
Ronny Pfannschmidt 2017-07-05 06:14:25 +02:00 committed by GitHub
commit db24a3b0fb
4 changed files with 7 additions and 7 deletions

View File

@ -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",

1
changelog/2444.trivial Normal file
View File

@ -0,0 +1 @@
Update help message for ``--strict`` to make it clear it only deals with unregistered markers, not warnings.

View File

@ -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`:

View File

@ -576,7 +576,7 @@ class TestSkip(object):
def test_hello():
pass
""")
result = testdir.runpytest("-rs --strict")
result = testdir.runpytest("-rs")
result.stdout.fnmatch_lines([
"*unconditional skip*",
"*1 skipped*",