MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / _fix_html_report

Function _fix_html_report

seleniumbase/plugins/pytest_plugin.py:2233–2253  ·  view source on GitHub ↗
(report_path)

Source from the content-addressed store, hash-verified

2231
2232
2233def _fix_html_report(report_path):
2234 # (Only if there's a pytest-html report present)
2235 with suppress(Exception):
2236 abs_path = os.path.abspath(".")
2237 html_report_path = os.path.join(abs_path, report_path)
2238 if not os.path.exists(html_report_path):
2239 return
2240 the_html_r = None
2241 with open(html_report_path, mode="r", encoding="utf-8") as f:
2242 the_html_r = f.read()
2243 if "page to ge the" not in the_html_r:
2244 return # The typo was already fixed
2245 # Collapsible rows are trickier to select for copy/paste
2246 the_html_r = the_html_r.replace(
2247 "findAll('.collapsible", "//findAll('.collapsible"
2248 )
2249 # Fix typo in pytest-html 4.0.2
2250 # (Later versions have a worse bug that prevents live updates)
2251 the_html_r = the_html_r.replace("page to ge the", "page to get the")
2252 with open(html_report_path, mode="w", encoding="utf-8") as f:
2253 f.write(the_html_r) # Update the HTML report
2254
2255
2256def pytest_runtest_teardown(item):

Callers 2

pytest_collection_finishFunction · 0.85
pytest_runtest_logreportFunction · 0.85

Calls 1

writeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…