def METHOD_NAME(self):
    def f(a, b=None, *, c=None):
        pass
    with self.assertRaises(TypeError) as exc:
        f(1, 2, 3)
    expected = (f"{f.__qualname__}() takes from 1 to 2 "
                "positional arguments but 3 were given")
    self.assertEqual(str(exc.exception), expected)