Skip to content

Commit 3ad5b9d

Browse files
committed
Docs: config.option is deprecated
https://pytest.org/latest/writing_plugins.html#_pytest.config.Config says config.option is deprecated and one should use config.getoption() instead.
1 parent 9b6dc93 commit 3ad5b9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/en/example/simple.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,13 @@ which will add the string to the test header accordingly::
273273
274274
You can also return a list of strings which will be considered as several
275275
lines of information. You can of course also make the amount of reporting
276-
information on e.g. the value of ``config.option.verbose`` so that
276+
information on e.g. the value of ``config.getoption('verbose')`` so that
277277
you present more information appropriately::
278278

279279
# content of conftest.py
280280

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

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

0 commit comments

Comments
 (0)