mypy: Add specific codes to type: ignore annotations.

https://mypy.readthedocs.io/en/stable/error_codes.html

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-04-21 19:13:37 -07:00
committed by Tim Abbott
parent 029bfb9fee
commit f8c95cda51
37 changed files with 145 additions and 140 deletions

View File

@@ -73,7 +73,7 @@ class WebhooksCommonTestCase(ZulipTestCase):
last_message_id = self.get_last_message().id
with self.assertRaisesRegex(JsonableError, "Malformed JSON"):
my_webhook_no_notify(request) # type: ignore # mypy doesn't seem to apply the decorator
my_webhook_no_notify(request) # type: ignore[call-arg] # mypy doesn't seem to apply the decorator
# First verify that without the setting, it doesn't send a PM to bot owner.
msg = self.get_last_message()
@@ -82,7 +82,7 @@ class WebhooksCommonTestCase(ZulipTestCase):
# Then verify that with the setting, it does send such a message.
with self.assertRaisesRegex(JsonableError, "Malformed JSON"):
my_webhook_notify(request) # type: ignore # mypy doesn't seem to apply the decorator
my_webhook_notify(request) # type: ignore[call-arg] # mypy doesn't seem to apply the decorator
msg = self.get_last_message()
self.assertNotEqual(msg.id, last_message_id)
self.assertEqual(msg.sender.email, self.notification_bot().email)