assertEqual takes as a third parameter an assertion message for failure.
class TestMyTest(unittest.TestCase):
def test_example(self):
a = 'a'
b = 'b'
self.assertEqual(a, b, 'a did not equal b')
prints the stack trace of the failing location plus
AssertionError: a did not equal b
Reference: https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertEqual