@@ -54,7 +54,7 @@ def pytest_addhooks(pluginmanager: "PytestPluginManager") -> None:
54
54
"""Called at plugin registration time to allow adding new hooks via a call to
55
55
:func:`pluginmanager.add_hookspecs(module_or_class, prefix) <pytest.PytestPluginManager.add_hookspecs>`.
56
56
57
- :param pytest.PytestPluginManager pluginmanager: The pytest plugin manager.
57
+ :param pluginmanager: The pytest plugin manager.
58
58
59
59
.. note::
60
60
This hook is incompatible with hook wrappers.
@@ -68,7 +68,7 @@ def pytest_plugin_registered(
68
68
"""A new pytest plugin got registered.
69
69
70
70
:param plugin: The plugin module or instance.
71
- :param pytest.PytestPluginManager manager: pytest plugin manager.
71
+ :param manager: pytest plugin manager.
72
72
73
73
.. note::
74
74
This hook is incompatible with hook wrappers.
@@ -86,13 +86,13 @@ def pytest_addoption(parser: "Parser", pluginmanager: "PytestPluginManager") ->
86
86
files situated at the tests root directory due to how pytest
87
87
:ref:`discovers plugins during startup <pluginorder>`.
88
88
89
- :param pytest.Parser parser:
89
+ :param parser:
90
90
To add command line options, call
91
91
:py:func:`parser.addoption(...) <pytest.Parser.addoption>`.
92
92
To add ini-file values call :py:func:`parser.addini(...)
93
93
<pytest.Parser.addini>`.
94
94
95
- :param pytest.PytestPluginManager pluginmanager:
95
+ :param pluginmanager:
96
96
The pytest plugin manager, which can be used to install :py:func:`~pytest.hookspec`'s
97
97
or :py:func:`~pytest.hookimpl`'s and allow one plugin to call another plugin's hooks
98
98
to change how command line options are added.
@@ -127,7 +127,7 @@ def pytest_configure(config: "Config") -> None:
127
127
.. note::
128
128
This hook is incompatible with hook wrappers.
129
129
130
- :param pytest.Config config: The pytest config object.
130
+ :param config: The pytest config object.
131
131
"""
132
132
133
133
@@ -156,18 +156,6 @@ def pytest_cmdline_parse(
156
156
"""
157
157
158
158
159
- @hookspec (firstresult = True )
160
- def pytest_cmdline_main (config : "Config" ) -> Optional [Union ["ExitCode" , int ]]:
161
- """Called for performing the main command line action. The default
162
- implementation will invoke the configure hooks and runtest_mainloop.
163
-
164
- Stops at first non-None result, see :ref:`firstresult`.
165
-
166
- :param config: The pytest config object.
167
- :returns: The exit code.
168
- """
169
-
170
-
171
159
def pytest_load_initial_conftests (
172
160
early_config : "Config" , parser : "Parser" , args : List [str ]
173
161
) -> None :
@@ -183,6 +171,20 @@ def pytest_load_initial_conftests(
183
171
"""
184
172
185
173
174
+ @hookspec (firstresult = True )
175
+ def pytest_cmdline_main (config : "Config" ) -> Optional [Union ["ExitCode" , int ]]:
176
+ """Called for performing the main command line action.
177
+
178
+ The default implementation will invoke the configure hooks and
179
+ :hook:`pytest_runtestloop`.
180
+
181
+ Stops at first non-None result, see :ref:`firstresult`.
182
+
183
+ :param config: The pytest config object.
184
+ :returns: The exit code.
185
+ """
186
+
187
+
186
188
# -------------------------------------------------------------------------
187
189
# collection hooks
188
190
# -------------------------------------------------------------------------
@@ -435,7 +437,7 @@ def pytest_make_parametrize_id(
435
437
436
438
:param config: The pytest config object.
437
439
:param val: The parametrized value.
438
- :param str argname: The automatic parameter name produced by pytest.
440
+ :param argname: The automatic parameter name produced by pytest.
439
441
"""
440
442
441
443
0 commit comments