There's just a small change. When you use assertRaises, be sure not to call the function directly. Instead, its arguments need to be passed as arguments to assertRaises. That allows the assertRaises test method to set-up a try/except before the function is invoked.
def test_raise(self):
"""Learn how to create an exception and test its implementation."""
self.assertRaises(LearningError, addition_no_four, 2, 4)
You can also bypass this issue by using assertRaises as a content manager:
def test_raise(self):
"""Learn how to create an exception and test its implementation."""
with self.assertRaises(LearningError):
addition_no_four(2, 4)