title: Printing to stdout and XML file using Python unittest-xml-reporting
body: <p>I am using an extension of python's unittest, <a href="https://github.com/danielfm/unittest-xml-reporting" rel="nofollow">unittest-xml-reporting</a>. It currently captures stdout and stores it in the xml output file. Awesome! But, I also want to echo it to the screen so I don't have to view that file every time I run my test suite. The two main functions involved are:</p>
  
  <pre><code>def _patch_standard_output(self):
      """Replace the stdout and stderr streams with string-based streams
      in order to capture the tests' output.
      """
      (self.old_stdout, self.old_stderr) = (sys.stdout, sys.stderr)
      (sys.stdout, sys.stderr) = (self.stdout, self.stderr) = \
          (StringIO(), StringIO())
  
  def _restore_standard_output(self):
      "Restore the stdout and stderr streams."
      (sys.stdout, sys.stderr) = (self.old_stdout, self.old_stderr)
  </code></pre>
  
  <p>I tried removing the</p>
  
  <pre><code>(sys.stdout, sys.stderr) = (self.stdout, self.stderr) = (StringIO(), StringIO())
  </code></pre>
  
  <p>and replace it with </p>
  
  <pre><code>(self.stdout, self.stderr) = (StringIO(), StringIO())
  </code></pre>
  
  <p>but then it did not add it to the xml file. Any help is appreciated. I'll be glad to submit a pull request when I get it working too!</p>