From 6377bc78ca09ab1a5478f62bc6ea9bd76cf6191f Mon Sep 17 00:00:00 2001 From: William Brown Date: Oct 11 2019 01:10:13 +0000 Subject: Ticket 50627 - Support platforms without pytest_html Bug Description: On systems without pytest_html the conftest hook would cause tests to fail Fix Description: If pytest_html is none, don't write the report to avoid the failure. Fixes: https://pagure.io/389-ds-base/issue/50627 Author: William Brown Review by: vashirov --- diff --git a/dirsrvtests/conftest.py b/dirsrvtests/conftest.py index 8c0d65f..f8710b3 100644 --- a/dirsrvtests/conftest.py +++ b/dirsrvtests/conftest.py @@ -94,7 +94,7 @@ def pytest_runtest_makereport(item, call): outcome = yield report = outcome.get_result() extra = getattr(report, 'extra', []) - if report.when == 'call': + if report.when == 'call' and pytest_html is not None: for f in glob.glob(f'{p.run_dir}/ns-slapd-*san*'): with open(f) as asan_report: text = asan_report.read()