def METHOD_NAME(self: typing.Any):
    @gen.coroutine
    def f():
        with self.assertRaisesRegex(CapError, "already capitalized"):
            yield self.client.capitalize("HELLO")
    self.io_loop.run_sync(f)