Skip to content

Commit 9a23859

Browse files
committed
Update pytest reports
1 parent f4c3f24 commit 9a23859

File tree

5 files changed

+18
-2
lines changed

5 files changed

+18
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ latest_report
100100
report_archives
101101
archived_reports
102102
html_report.html
103+
last_report.html
103104
report.html
104105
report.xml
105106

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ execnet==2.1.1
4444
iniconfig==2.0.0
4545
pluggy==1.5.0
4646
pytest==8.3.4
47-
pytest-html==4.1.1
47+
pytest-html==4.0.2
4848
pytest-metadata==3.1.1
4949
pytest-ordering==0.6
5050
pytest-rerunfailures==14.0;python_version<"3.9"

seleniumbase/console_scripts/sb_mkdir.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ def main():
259259
data.append("report_archives")
260260
data.append("archived_reports")
261261
data.append("html_report.html")
262+
data.append("last_report.html")
262263
data.append("report.html")
263264
data.append("report.xml")
264265
data.append("dashboard.html")

seleniumbase/plugins/pytest_plugin.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,6 +1709,7 @@ def pytest_configure(config):
17091709
sb_config._saved_dashboard_pie = None # Copy of pie chart for html report
17101710
sb_config._dash_final_summary = None # Dash status to add to html report
17111711
sb_config._html_report_name = None # The name of the pytest html report
1712+
sb_config._html_report_copy = None # The copy of the pytest html report
17121713

17131714
arg_join = " ".join(sys_argv)
17141715
if (
@@ -1742,6 +1743,7 @@ def pytest_configure(config):
17421743
if sb_config.dashboard:
17431744
if sb_config._html_report_name == "dashboard.html":
17441745
sb_config._dash_is_html_report = True
1746+
sb_config._html_report_copy = "last_report.html"
17451747

17461748
# Recorder Mode does not support multi-threaded / multi-process runs.
17471749
if sb_config.recorder_mode and sb_config._multithreaded:
@@ -2151,6 +2153,10 @@ def _perform_pytest_unconfigure_(config):
21512153
html_report_path = os.path.join(
21522154
abs_path, sb_config._html_report_name
21532155
)
2156+
if sb_config._html_report_copy:
2157+
html_report_path_copy = os.path.join(
2158+
abs_path, sb_config._html_report_copy
2159+
)
21542160
if (
21552161
sb_config._using_html_report
21562162
and html_report_path
@@ -2201,6 +2207,8 @@ def _perform_pytest_unconfigure_(config):
22012207
)
22022208
with open(html_report_path, "w", encoding="utf-8") as f:
22032209
f.write(the_html_r) # Finalize the HTML report
2210+
with open(html_report_path_copy, "w", encoding="utf-8") as f:
2211+
f.write(the_html_r) # Finalize the HTML report
22042212
# Done with "pytest_unconfigure" unless using the Dashboard
22052213
return
22062214
stamp = ""
@@ -2288,6 +2296,10 @@ def _perform_pytest_unconfigure_(config):
22882296
html_report_path = os.path.join(
22892297
abs_path, sb_config._html_report_name
22902298
)
2299+
if sb_config._html_report_copy:
2300+
html_report_path_copy = os.path.join(
2301+
abs_path, sb_config._html_report_copy
2302+
)
22912303
if (
22922304
sb_config._using_html_report
22932305
and html_report_path
@@ -2358,6 +2370,8 @@ def _perform_pytest_unconfigure_(config):
23582370
)
23592371
with open(html_report_path, "w", encoding="utf-8") as f:
23602372
f.write(the_html_r) # Finalize the HTML report
2373+
with open(html_report_path_copy, "w", encoding="utf-8") as f:
2374+
f.write(the_html_r) # Finalize the HTML report
23612375
except KeyboardInterrupt:
23622376
pass
23632377
except Exception:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
'iniconfig==2.0.0',
194194
'pluggy==1.5.0',
195195
'pytest==8.3.4',
196-
"pytest-html==4.1.1",
196+
"pytest-html==4.0.2",
197197
'pytest-metadata==3.1.1',
198198
"pytest-ordering==0.6",
199199
'pytest-rerunfailures==14.0;python_version<"3.9"',

0 commit comments

Comments
 (0)