Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typing: Avoid redefining variable with different types.

PIG2088fd89f87e041
diff --git a/zerver/tests/test_bots.py b/zerver/tests/test_bots.py
index 7f5138dc2ee..837a33bb13e 100644
--- a/zerver/tests/test_bots.py
+++ b/zerver/tests/test_bots.py
@@ -239,7 +239,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
def test_add_bot_with_username_in_use(self) -> None:
self.login("hamlet")
self.assert_num_bots_equal(0)
- result = self.create_bot()
+ self.create_bot()
self.assert_num_bots_equal(1)
# The short_name is used in the email, which we call
@@ -395,7 +395,7 @@ class BotTest(ZulipTestCase, UploadSerializeMixin):
# Create a bot.
self.assert_num_bots_equal(0)
- result = self.create_bot()
+ self.create_bot()
self.assert_num_bots_equal(1)
# A bot
diff --git a/zerver/tests/test_openapi.py b/zerver/tests/test_openapi.py
index ca3be53355e..fd2265c99bb 100644
--- a/zerver/tests/test_openapi.py
+++ b/zerver/tests/test_openapi.py
@@ -13,6 +13,7 @@ from jsonschema.exceptions import ValidationError
from zerver.lib.request import _REQ, arguments_map
from zerver.lib.rest import rest_dispatch
from zerver.lib.test_classes import ZulipTestCase
+from zerver.lib.utils import assert_is_not_none
from zerver.openapi.markdown_extension import (
generate_curl_example,
parse_language_and_options,
@@ -523,11 +524,11 @@ do not match the types declared in the implementation of {function.__name__}.\n"
for p in urlconf.v1_api_and_json_patterns + urlconf.v1_api_mobile_patterns:
if p.callback is not rest_dispatch:
# Endpoints not using rest_dispatch don't have extra data.
- methods_endpoints = dict(
+ methods_endpoints: Dict[str, Any] = dict(
GET=p.callback,
)
else:
- methods_endpoints = p.default_args
+ methods_endpoints = assert_is_not_none(p.default_args)
# since the module was already imported and is now residing in
# memory, we won't actually face any performance penalties here.