If I\'m writing unit tests in python (using the unittest module), is it possible to output data from a failed test, so I can examine it to help deduce what caused the error?
Expanding @F.C. 's answer, this works quite well for me:
class MyTest(unittest.TestCase): def messenger(self, message): try: self.assertEqual(1, 2, msg=message) except AssertionError as e: print "\nMESSENGER OUTPUT: %s" % str(e),