added docs about the `no:` syntax for the -p option

--HG--
branch : no-p-option
This commit is contained in:
Simon Liedtke 2014-01-19 22:05:14 +01:00
parent 492c60c202
commit d92ee8c3c3
2 changed files with 14 additions and 1 deletions

View File

@ -12,7 +12,9 @@ def pytest_addoption(parser):
help="show help message and configuration info") help="show help message and configuration info")
group._addoption('-p', action="append", dest="plugins", default = [], group._addoption('-p', action="append", dest="plugins", default = [],
metavar="name", 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', group.addoption('--traceconfig', '--trace-config',
action="store_true", default=False, action="store_true", default=False,
help="trace considerations of conftest.py files."), help="trace considerations of conftest.py files."),

View File

@ -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. 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`: .. _`pytest.main-usage`:
Calling pytest from Python code Calling pytest from Python code