@@ -73,15 +73,19 @@ def pytest_configure(config):
73
73
74
74
@hookspec (firstresult = True )
75
75
def pytest_cmdline_parse (pluginmanager , args ):
76
- """return initialized config object, parsing the specified args. """
76
+ """return initialized config object, parsing the specified args.
77
+
78
+ Stops at first non-None result, see :ref:`firstresult` """
77
79
78
80
def pytest_cmdline_preparse (config , args ):
79
81
"""(deprecated) modify command line arguments before option parsing. """
80
82
81
83
@hookspec (firstresult = True )
82
84
def pytest_cmdline_main (config ):
83
85
""" called for performing the main command line action. The default
84
- implementation will invoke the configure hooks and runtest_mainloop. """
86
+ implementation will invoke the configure hooks and runtest_mainloop.
87
+
88
+ Stops at first non-None result, see :ref:`firstresult` """
85
89
86
90
def pytest_load_initial_conftests (early_config , parser , args ):
87
91
""" implements the loading of initial conftest files ahead
@@ -94,7 +98,9 @@ def pytest_load_initial_conftests(early_config, parser, args):
94
98
95
99
@hookspec (firstresult = True )
96
100
def pytest_collection (session ):
97
- """ perform the collection protocol for the given session. """
101
+ """ perform the collection protocol for the given session.
102
+
103
+ Stops at first non-None result, see :ref:`firstresult` """
98
104
99
105
def pytest_collection_modifyitems (session , config , items ):
100
106
""" called after collection has been performed, may filter or re-order
@@ -108,11 +114,15 @@ def pytest_ignore_collect(path, config):
108
114
""" return True to prevent considering this path for collection.
109
115
This hook is consulted for all files and directories prior to calling
110
116
more specific hooks.
117
+
118
+ Stops at first non-None result, see :ref:`firstresult`
111
119
"""
112
120
113
121
@hookspec (firstresult = True )
114
122
def pytest_collect_directory (path , parent ):
115
- """ called before traversing a directory for collection files. """
123
+ """ called before traversing a directory for collection files.
124
+
125
+ Stops at first non-None result, see :ref:`firstresult` """
116
126
117
127
def pytest_collect_file (path , parent ):
118
128
""" return collection Node or None for the given path. Any new node
@@ -133,7 +143,9 @@ def pytest_deselected(items):
133
143
134
144
@hookspec (firstresult = True )
135
145
def pytest_make_collect_report (collector ):
136
- """ perform ``collector.collect()`` and return a CollectReport. """
146
+ """ perform ``collector.collect()`` and return a CollectReport.
147
+
148
+ Stops at first non-None result, see :ref:`firstresult` """
137
149
138
150
# -------------------------------------------------------------------------
139
151
# Python test function related hooks
@@ -145,15 +157,20 @@ def pytest_pycollect_makemodule(path, parent):
145
157
This hook will be called for each matching test module path.
146
158
The pytest_collect_file hook needs to be used if you want to
147
159
create test modules for files that do not match as a test module.
148
- """
160
+
161
+ Stops at first non-None result, see :ref:`firstresult` """
149
162
150
163
@hookspec (firstresult = True )
151
164
def pytest_pycollect_makeitem (collector , name , obj ):
152
- """ return custom item/collector for a python object in a module, or None. """
165
+ """ return custom item/collector for a python object in a module, or None.
166
+
167
+ Stops at first non-None result, see :ref:`firstresult` """
153
168
154
169
@hookspec (firstresult = True )
155
170
def pytest_pyfunc_call (pyfuncitem ):
156
- """ call underlying test function. """
171
+ """ call underlying test function.
172
+
173
+ Stops at first non-None result, see :ref:`firstresult` """
157
174
158
175
def pytest_generate_tests (metafunc ):
159
176
""" generate (multiple) parametrized calls to a test function."""
@@ -163,7 +180,8 @@ def pytest_make_parametrize_id(config, val, argname):
163
180
"""Return a user-friendly string representation of the given ``val`` that will be used
164
181
by @pytest.mark.parametrize calls. Return None if the hook doesn't know about ``val``.
165
182
The parameter name is available as ``argname``, if required.
166
- """
183
+
184
+ Stops at first non-None result, see :ref:`firstresult` """
167
185
168
186
# -------------------------------------------------------------------------
169
187
# generic runtest related hooks
@@ -172,7 +190,9 @@ def pytest_make_parametrize_id(config, val, argname):
172
190
@hookspec (firstresult = True )
173
191
def pytest_runtestloop (session ):
174
192
""" called for performing the main runtest loop
175
- (after collection finished). """
193
+ (after collection finished).
194
+
195
+ Stops at first non-None result, see :ref:`firstresult` """
176
196
177
197
def pytest_itemstart (item , node ):
178
198
""" (deprecated, use pytest_runtest_logstart). """
@@ -190,7 +210,9 @@ def pytest_runtest_protocol(item, nextitem):
190
210
:py:func:`pytest_runtest_teardown`.
191
211
192
212
:return boolean: True if no further hook implementations should be invoked.
193
- """
213
+
214
+
215
+ Stops at first non-None result, see :ref:`firstresult` """
194
216
195
217
def pytest_runtest_logstart (nodeid , location ):
196
218
""" signal the start of running a single test item. """
@@ -215,7 +237,8 @@ def pytest_runtest_makereport(item, call):
215
237
""" return a :py:class:`_pytest.runner.TestReport` object
216
238
for the given :py:class:`pytest.Item <_pytest.main.Item>` and
217
239
:py:class:`_pytest.runner.CallInfo`.
218
- """
240
+
241
+ Stops at first non-None result, see :ref:`firstresult` """
219
242
220
243
def pytest_runtest_logreport (report ):
221
244
""" process a test setup/call/teardown report relating to
@@ -227,7 +250,9 @@ def pytest_runtest_logreport(report):
227
250
228
251
@hookspec (firstresult = True )
229
252
def pytest_fixture_setup (fixturedef , request ):
230
- """ performs fixture setup execution. """
253
+ """ performs fixture setup execution.
254
+
255
+ Stops at first non-None result, see :ref:`firstresult` """
231
256
232
257
def pytest_fixture_post_finalizer (fixturedef ):
233
258
""" called after fixture teardown, but before the cache is cleared so
@@ -277,7 +302,9 @@ def pytest_report_header(config, startdir):
277
302
278
303
@hookspec (firstresult = True )
279
304
def pytest_report_teststatus (report ):
280
- """ return result-category, shortletter and verbose word for reporting."""
305
+ """ return result-category, shortletter and verbose word for reporting.
306
+
307
+ Stops at first non-None result, see :ref:`firstresult` """
281
308
282
309
def pytest_terminal_summary (terminalreporter , exitstatus ):
283
310
""" add additional section in terminal summary reporting. """
@@ -295,7 +322,9 @@ def pytest_logwarning(message, code, nodeid, fslocation):
295
322
296
323
@hookspec (firstresult = True )
297
324
def pytest_doctest_prepare_content (content ):
298
- """ return processed content for a given doctest"""
325
+ """ return processed content for a given doctest
326
+
327
+ Stops at first non-None result, see :ref:`firstresult` """
299
328
300
329
# -------------------------------------------------------------------------
301
330
# error handling and internal debugging hooks
0 commit comments