Skip to content

Commit 6ff7b96

Browse files
ssbarneaRibeiroAna
authored andcommitted
Allow opening generated html report in browser (#208)
By default terminals would open files in editors and URLs in browsers. By printing the generated html report using an URL (file://) we enable users to click the terminal to open it. Previously this opened the file in the text editor which is very unlikely to be what user would want.
1 parent 67dc737 commit 6ff7b96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytest_html/plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,5 +521,6 @@ def pytest_sessionfinish(self, session):
521521
self._save_report(report_content)
522522

523523
def pytest_terminal_summary(self, terminalreporter):
524-
terminalreporter.write_sep('-', 'generated html file: {0}'.format(
525-
self.logfile))
524+
terminalreporter.write_sep(
525+
'-',
526+
'generated html file: file://{0}'.format(self.logfile))

0 commit comments

Comments
 (0)