title: Pytest-html custom report
body: <p>I'm using pytest to run my tests, and using pytest html to generate a report.</p>
  <p>i'm trying to show the error\skip message in cases of failure or skip in the report, using the value form <code>call.excinfo.value</code>.<br />
  i notice that <code>pytest_runtest_makereport</code> is being called multiple times, for <code>setup</code>, <code>call</code> and <code>teardown</code>, and since <code>call.excinfo.value</code> in <code>setup</code> and <code>teardown</code> is null, it is overwriting the message in the cell, and as a result the <code>error message</code> cell is empty.</p>
  <p>so, i tried to update the value with the following condition <code>report.when == &quot;call&quot;</code>,<br />
  but i'm getting the following error when <code>pytest_html_results_table_row</code> is executing on <code>setup</code> and <code>teardown</code>:</p>
  <p><code>AttributeError: 'TestReport' object has no attribute 'error_message'</code></p>
  <p>here is the code that i tried:</p>
  <pre><code># in conftest.py
  @pytest.mark.optionalhook
  def pytest_html_results_table_header(cells):
      cells.insert(1, html.th('Error Message'))
  
  
  @pytest.mark.optionalhook
  def pytest_html_results_table_row(report, cells):
      cells.insert(1, html.td(report.error_message))
  
  
  
  @pytest.mark.hookwrapper
  def pytest_runtest_makereport(item, call):
      outcome = yield
      report = outcome.get_result()
      if report.when == &quot;call&quot; and report.skipped or report.failed:
          report.error_message = str(call.excinfo.value) if call.excinfo else &quot;&quot;
     
  </code></pre>
  <p>is there another way to show the error message in the report for failure\skipped.<br />
  p.s: for tests that are passed the value should be an empty string</p>
  <p>here is what i expect to achieve:
  <a href="https://i.stack.imgur.com/dhgDp.png" rel="nofollow noreferrer">expected report</a></p>