File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ def pytest_sessionstart(self, session):
151
151
152
152
headers = self ._report .data ["resultsTableHeader" ]
153
153
session .config .hook .pytest_html_results_table_header (cells = headers )
154
+ self ._report .data ["resultsTableHeader" ] = _fix_py (headers )
154
155
155
156
self ._report .set_data ("runningState" , "Started" )
156
157
self ._generate_report ()
@@ -216,6 +217,7 @@ def pytest_runtest_logreport(self, report):
216
217
if not cells :
217
218
return
218
219
220
+ cells = _fix_py (cells )
219
221
data ["resultsTableRow" ] = cells
220
222
221
223
processed_logs = _process_logs (report )
@@ -279,3 +281,20 @@ def _process_outcome(report):
279
281
def _process_links (links ):
280
282
a_tag = '<a target="_blank" href="{content}" class="col-links__extra {format_type}">{name}</a>'
281
283
return "" .join ([a_tag .format_map (link ) for link in links ])
284
+
285
+
286
+ def _fix_py (cells ):
287
+ # backwards-compat
288
+ new_cells = []
289
+ for html in cells :
290
+ if not isinstance (html , str ):
291
+ if html .__module__ .startswith ("py." ):
292
+ warnings .warn (
293
+ "The 'py' module is deprecated and support "
294
+ "will be removed in a future release." ,
295
+ DeprecationWarning ,
296
+ )
297
+ html = str (html )
298
+ html = html .replace ("col=" , "data-column-type=" )
299
+ new_cells .append (html )
300
+ return new_cells
You can’t perform that action at this time.
0 commit comments