Refactor TooManyRequestsErrorTest

Use a lambda instead of defining a function for assertRaises and remove
unnecessary comment.