diff --git a/_pytest/main.py b/_pytest/main.py index e6f679a37..1a6ba2781 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -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", diff --git a/changelog/2444.trivial b/changelog/2444.trivial new file mode 100644 index 000000000..4d6e2de5b --- /dev/null +++ b/changelog/2444.trivial @@ -0,0 +1 @@ +Update help message for ``--strict`` to make it clear it only deals with unregistered markers, not warnings. diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index d74d16e9d..40338fba8 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -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`: diff --git a/testing/test_skipping.py b/testing/test_skipping.py index 5f25c3e6e..5a6692b3c 100644 --- a/testing/test_skipping.py +++ b/testing/test_skipping.py @@ -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*",