You can pass assertEqual the third argument (technically the fourth if you consider yourself), which is an error message that it will return. So the following should do more or less of what you are looking for:
class MethodTest(TestCase): def test_method(self): obj = MyClass() for method in "frob", "defrob", "refrob": self.assertEqual(getattr(obj, method)(), 42, "obj.%s() is not equal to 42" % method)
source share