title: Python: How to access test result variables from unittest module
body: <p>For a specific program I'm working in, we need to evaluate some code, then run a <em>unittest</em>, and then depending on whether or not the test failed, do A or B.</p>
  
  <p>But the usual <strong>self.assertEqual(...)</strong> seems to display the results (fail, errors, success) instead of saving them somewhere, so I can't access that result.
  I have been checking the modules of unittest for days but I can't figure out where does the magic happen or if there is somewhere a variable I can call to know the result of the test without having to read the screen (making the program read and try to find the words "error" or "failed" doesn't sound like a good solution).</p>