MCPcopy Create free account
hub / github.com/pytest-dev/pytest / pytest_addoption

Function pytest_addoption

src/_pytest/python.py:90–133  ·  view source on GitHub ↗
(parser: Parser)

Source from the content-addressed store, hash-verified

88
89
90def pytest_addoption(parser: Parser) -> None:
91 group = parser.getgroup("general")
92 group.addoption(
93 "--fixtures",
94 "--funcargs",
95 action="store_true",
96 dest="showfixtures",
97 default=False,
98 help="show available fixtures, sorted by plugin appearance "
99 "(fixtures with leading '_' are only shown with '-v')",
100 )
101 group.addoption(
102 "--fixtures-per-test",
103 action="store_true",
104 dest="show_fixtures_per_test",
105 default=False,
106 help="show fixtures per test",
107 )
108 parser.addini(
109 "python_files",
110 type="args",
111 # NOTE: default is also used in AssertionRewritingHook.
112 default=["test_*.py", "*_test.py"],
113 help="glob-style file patterns for Python test module discovery",
114 )
115 parser.addini(
116 "python_classes",
117 type="args",
118 default=["Test"],
119 help="prefixes or glob names for Python test class discovery",
120 )
121 parser.addini(
122 "python_functions",
123 type="args",
124 default=["test"],
125 help="prefixes or glob names for Python test function and method discovery",
126 )
127 parser.addini(
128 "disable_test_id_escaping_and_forfeit_all_rights_to_community_support",
129 type="bool",
130 default=False,
131 help="disable string escape non-ascii characters, might cause unwanted "
132 "side effects(use at your own risk)",
133 )
134
135
136def pytest_cmdline_main(config: Config) -> Optional[Union[int, ExitCode]]:

Callers

nothing calls this directly

Calls 3

getgroupMethod · 0.80
addiniMethod · 0.80
addoptionMethod · 0.45

Tested by

no test coverage detected