MCPcopy
hub / github.com/pytest-dev/pytest / pytest_addoption

Function pytest_addoption

src/_pytest/helpconfig.py:59–119  ·  view source on GitHub ↗
(parser: Parser)

Source from the content-addressed store, hash-verified

57
58
59def pytest_addoption(parser: Parser) -> None:
60 group = parser.getgroup("debugconfig")
61 group.addoption(
62 "-V",
63 "--version",
64 action="count",
65 default=0,
66 dest="version",
67 help="Display pytest version and information about plugins. "
68 "When given twice, also display information about plugins.",
69 )
70 group._addoption( # private to use reserved lower-case short option
71 "-h",
72 "--help",
73 action=HelpAction,
74 dest="help",
75 help="Show help message and configuration info",
76 )
77 group._addoption( # private to use reserved lower-case short option
78 "-p",
79 action="append",
80 dest="plugins",
81 default=[],
82 metavar="name",
83 help="Early-load given plugin module name or entry point (multi-allowed). "
84 "To avoid loading of plugins, use the `no:` prefix, e.g. "
85 "`no:doctest`. See also --disable-plugin-autoload.",
86 )
87 group.addoption(
88 "--disable-plugin-autoload",
89 action="store_true",
90 default=False,
91 help="Disable plugin auto-loading through entry point packaging metadata. "
92 "Only plugins explicitly specified in -p or env var PYTEST_PLUGINS will be loaded.",
93 )
94 group.addoption(
95 "--traceconfig",
96 "--trace-config",
97 action="store_true",
98 default=False,
99 help="Trace considerations of conftest.py files",
100 )
101 group.addoption(
102 "--debug",
103 action="store",
104 nargs="?",
105 const="pytestdebug.log",
106 dest="debug",
107 metavar="DEBUG_FILE_NAME",
108 help="Store internal tracing debug information in this log file. "
109 "This file is opened with 'w' and truncated as a result, care advised. "
110 "Default: pytestdebug.log.",
111 )
112 group._addoption( # private to use reserved lower-case short option
113 "-o",
114 "--override-ini",
115 dest="override_ini",
116 action="append",

Callers

nothing calls this directly

Calls 3

getgroupMethod · 0.80
_addoptionMethod · 0.80
addoptionMethod · 0.45

Tested by

no test coverage detected