From e5a02e0b02cc92717a2e2ad8e2a738da52fe86e1 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Wed, 5 Jun 2019 12:43:29 +0100 Subject: [PATCH] Allow opening generated html report in browser 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. --- pytest_html/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pytest_html/plugin.py b/pytest_html/plugin.py index e66840de..744745a8 100644 --- a/pytest_html/plugin.py +++ b/pytest_html/plugin.py @@ -521,5 +521,6 @@ def pytest_sessionfinish(self, session): self._save_report(report_content) def pytest_terminal_summary(self, terminalreporter): - terminalreporter.write_sep('-', 'generated html file: {0}'.format( - self.logfile)) + terminalreporter.write_sep( + '-', + 'generated html file: file://{0}'.format(self.logfile))