title: Save unittest results in text file
body: <p>I'm writing code that tests via unittest if several elements exist on a certain homepage. After the test I want that the results were saved in a text file. But the results in the text file look like this:</p>
  <pre><code>......................
  .........
  
  ------------------------------------------
  Ran 12 tests in 22.562s
  OK.
  </code></pre>
  <p>But i want that the output looks like this:</p>
  <pre><code>test_test1 (HomepageTest.HomePageTest) ... ok
  test_test2 (HomepageTest.HomePageTest) ... ok
  test_test3 (HomepageTest.HomePageTest) ... ok
  etc....
  -------------------------------------------------
  Ran 12 tests in ...s
  OK
  </code></pre>
  <p>This is the code I use for saving the output into a text file:</p>
  <pre><code>class SaveTestResults(object):
      def save(self):
         self.f = open(log_file, 'w')
         runner = unittest.TextTestRunner(self.f)
         unittest.main(testRunner = runner, defaultTest ='suite', verbosity = 2)
      
  def main():
      STR = SaveTestResults()
      STR.save()
  
  if __name__ == '__main__':
  main()
  </code></pre>
  <p>What am I missing or doing wrong?</p>