File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,27 @@ additional HTML and log output with a notice that the log is empty:
259
259
del data[:]
260
260
data.append(html.div(' No log output captured.' , class_ = ' empty log' ))
261
261
262
+ Modifying the whole test document
263
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
264
+
265
+ Finally, for major customizations, you may manipulate and update the resulting
266
+ html document prior to finalization by hooking :code: `pytest_html_report_final_dom `.
267
+
268
+ .. code-block :: python
269
+
270
+ import pytest
271
+
272
+ def pytest_html_report_final_dom (document ):
273
+ from importlib.resources import read_text
274
+ js = read_text(" ." , " fancy.js" )
275
+ for node in list (iter (document)):
276
+ if isinstance (node, html.head):
277
+ node.extend([html.script(raw(js), type = " text/javascript" )])
278
+
279
+
280
+
281
+
282
+
262
283
Display options
263
284
---------------
264
285
You can’t perform that action at this time.
0 commit comments