@@ -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 :
0 commit comments