title: Pytest-html Customization
body: <p>I am using pytest-html plugin for report generation for my test cases. I want to add a line item if the script fails. So here's my code---</p>
  
  <pre><code>import pytest
  
  @pytest.mark.hookwrapper
  def pytest_runtest_makereport(item, call):
      pytest_html = item.config.pluginmanager.getplugin('html')
      outcome = yield
      report = outcome.get_result()
      extra = getattr(report, 'extra', [])
      if report.when == 'call':
          # always add url to report
          extra.append(pytest_html.extras.url('http://www.example.com/'))
          xfail = hasattr(report, 'wasxfail')
          if (report.skipped and xfail) or (report.failed and not xfail):
              # only add additional html on failure
              extra.append(pytest_html.extras.html('&lt;div&gt;Additional HTML&lt;/div&gt;'))
          report.extra = extra
  
  def test_sayHello():
  
          assert False, "I mean for this to fail"
          print "hello"
  
  
  def test_sayBye():
          print "Bye"
  
  
  I am running the scipt using -
   pytest --html=report.html
  </code></pre>
  
  <p>I can see the report getting generatesd but it doesnt have a line item as Additional HTML.</p>
  
  <p>Also is there a way via which I can add such line items in between of my scripts to the report.</p>
  
  <p>Really appreciate help.</p>