Skip to content

Commit

Permalink
Docs: config.option is deprecated
Browse files Browse the repository at this point in the history
https://pytest.org/latest/writing_plugins.html#_pytest.config.Config says config.option is deprecated and one should use config.getoption() instead.
  • Loading branch information
mgedmin committed Jun 2, 2016
1 parent 9b6dc93 commit 3ad5b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/en/example/simple.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ which will add the string to the test header accordingly::
You can also return a list of strings which will be considered as several
lines of information. You can of course also make the amount of reporting
information on e.g. the value of ``config.option.verbose`` so that
information on e.g. the value of ``config.getoption('verbose')`` so that
you present more information appropriately::

# content of conftest.py

def pytest_report_header(config):
if config.option.verbose > 0:
if config.getoption('verbose') > 0:
return ["info1: did you know that ...", "did you?"]

which will add info only when run with "--v"::
Expand Down

0 comments on commit 3ad5b9d

Please sign in to comment.