def pytest_sessionfinish(session, exitstatus): failed_tests_template = template_env.get_template('failed_browser_tests.html') outfile = log_path.join('failed_browser_tests.html') # Clean out any old reports try: outfile.remove(ignore_errors=True) except ENOENT: pass # Generate a new one if needed if failed_test_tracking['tests']: failed_tests_report = failed_tests_template.render(**failed_test_tracking) outfile.write(failed_tests_report)
def generate(self): template = template_env.get_template('event_testing.html') return template.render( test_name=self.test_name, registered_events=self.registered_events, all_events=self.all_events)
def generate(self, filename): template = template_env.get_template('event_testing.html') with open(filename, "w") as outfile: outfile.write(template.render(events=self.events))