assertRaises in unittest not catching Exception properly
You should be passing arguments to the callable separately, as separate arguments:
self.assertRaises(TypeError, add, 1, '1', msg="Additon failed")
Try
def test_additon(self):
with self.assertRaises(TypeError):
add(1 + '1')
The problem is that the exception is raised during argument evaluation before self.assertRaises can kick in.