diff --git a/_pytest/helpconfig.py b/_pytest/helpconfig.py index 66a097a0c..aafc9458d 100644 --- a/_pytest/helpconfig.py +++ b/_pytest/helpconfig.py @@ -12,7 +12,9 @@ def pytest_addoption(parser): help="show help message and configuration info") group._addoption('-p', action="append", dest="plugins", default = [], metavar="name", - help="early-load given plugin (multi-allowed).") + help="early-load given plugin (multi-allowed). " + "To avoid loading of plugins, use the `no:` prefix, e.g. " + "`no:doctest`.") group.addoption('--traceconfig', '--trace-config', action="store_true", default=False, help="trace considerations of conftest.py files."), diff --git a/doc/en/usage.txt b/doc/en/usage.txt index c2d9e4b94..29a226dbc 100644 --- a/doc/en/usage.txt +++ b/doc/en/usage.txt @@ -153,6 +153,17 @@ for example ``-x`` if you only want to send one particular failure. Currently only pasting to the http://bpaste.net service is implemented. +Disabling plugins +----------------- + +To disable loading specific plugins at invocation time, use the ``-p`` option +together with the prefix ``no:``. + +Example: to disable loading the plugin ``doctest``, which is responsible for +executing doctest tests from text files, invoke py.test like this:: + + py.test -p no:doctest + .. _`pytest.main-usage`: Calling pytest from Python code