Browse Source

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
changes/10/792510/3
Federico Ressi 3 weeks ago
parent
commit
2e9db6ed31
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      tobiko/tests/conftest.py

+ 4
- 3
tobiko/tests/conftest.py View File

@ -108,16 +108,17 @@ def pytest_html_results_table_header(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.pop()
@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
report = outcome.get_result()
report.description = str(item.function.__doc__)
report.description = getattr(item.function, '__doc__', '')
def pytest_html_report_title(report):


Loading…
Cancel
Save