Fix bug in conftest script
This fixes below problem when making HTML report file: INTERNALERROR> AttributeError: 'CollectReport' object has no attribute 'description' Change-Id: Ie4165f676c6875c28234164024ea18fb265b1e6e
This commit is contained in:
parent
4f7e678f95
commit
2e9db6ed31
@ -108,16 +108,17 @@ def pytest_html_results_table_header(cells):
|
|||||||
|
|
||||||
|
|
||||||
def pytest_html_results_table_row(report, cells):
|
def pytest_html_results_table_row(report, cells):
|
||||||
cells.insert(2, html.td(report.description))
|
cells.insert(2, html.td(getattr(report, 'description', '')))
|
||||||
cells.insert(1, html.td(datetime.utcnow(), class_="col-time"))
|
cells.insert(1, html.td(datetime.utcnow(), class_="col-time"))
|
||||||
cells.pop()
|
cells.pop()
|
||||||
|
|
||||||
|
|
||||||
@pytest.hookimpl(hookwrapper=True)
|
@pytest.hookimpl(hookwrapper=True)
|
||||||
def pytest_runtest_makereport(item, call): # pylint: disable=unused-argument
|
def pytest_runtest_makereport(item, call):
|
||||||
|
# pylint: disable=unused-argument
|
||||||
outcome = yield
|
outcome = yield
|
||||||
report = outcome.get_result()
|
report = outcome.get_result()
|
||||||
report.description = str(item.function.__doc__)
|
report.description = getattr(item.function, '__doc__', '')
|
||||||
|
|
||||||
|
|
||||||
def pytest_html_report_title(report):
|
def pytest_html_report_title(report):
|
||||||
|
Loading…
Reference in New Issue
Block a user