title: Integration testing with Python unittest: how to improve granularity?
body: <p>I have a single end-to-end Selenium integration test which consists of several steps with each step setting certain state and passing the data over to the next step.</p>
  
  <p>Test scenario:</p>
  
  <pre><code>1. Create item.
  2. Assign item to group.
  3. Approve item.
  ...
  4. Publish item.
  </code></pre>
  
  <p>The steps are not atomic and depend on each other. The test class extends from <code>unittest.TestCase</code> and contains a single <code>test_xyz()</code> method which wraps the methods for each step.</p>
  
  <p>Currently, the final report only includes the pass/fail status for the wrapper <code>test_xyz()</code> method. I would like to have each step being treated as a 'test step' and have a separate entry in the test report.</p>
  
  <p>It feels wrong to convert all the steps into <code>test_step1()</code>, <code>test_step2()</code> etc and then enforcing the execution order and data exchange since the steps are not self-contained tests.</p>
  
  <p>Is there a way to mark certain methods as test steps so that they appear as separate entries in the test report? </p>
  
  <p>Basically, all I want is improving the visual reporting so that it is more obvious from the report at which step the entire integration test failed. Is this achievable with <code>unittest</code>? What would be the best practice in organizing the code so that it fits into the unittest paradigm?</p>
  
  <p>Not sure <code>unittest</code> is the best tool for integration tests, since this is not strictly speaking <em>unit testing</em>. Would switching to something like pytest make more sense for integration testing while still allowing 'free' HTML report generation? (I am currently using <a href="http://nose.readthedocs.io/" rel="noreferrer">nose</a> to run the test and to generate the HTML report with the corresponding <a href="https://pypi.python.org/pypi/nose-html-reporting" rel="noreferrer">nose plugin</a>.)</p>