Skip to content

Add driver log to HTML report even if there is no driver instance #149

@davehunt

Description

@davehunt

We currently only add the driver log to the HTML report if there is a driver instance, however this means we fail to include the logs when there is an issue actually creating the driver instance.

We should move the following lines from _gather_logs:

if item.config._driver_log and os.path.exists(item.config._driver_log):
if pytest_html is not None:
with io.open(item.config._driver_log, 'r', encoding='utf8') as f:
extra.append(pytest_html.extras.text(f.read(), 'Driver Log'))
summary.append('Driver log: {0}'.format(item.config._driver_log))

To outside the if driver is not None in pytest_runtest_makereport:

if driver is not None:

This should help with diagnosing issues when staring the driver instance, such as in mozilla/FoxPuppet#115

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions