mypy: Upgrade from 0.720 to 0.730.

Fixes #13269.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-11-12 18:24:14 -08:00
committed by Tim Abbott
parent 43bba63549
commit 40f4ead738
12 changed files with 42 additions and 43 deletions

View File

@@ -66,12 +66,13 @@ def test_generated_curl_examples_for_success(client: Client) -> None:
generated_curl_command = [
x for x in shlex.split(curl_command_text) if x != "\n"]
response_json = None
response = None
try:
# We split this across two lines so if curl fails and
# returns non-JSON output, we'll still print it.
response = subprocess.check_output(generated_curl_command).decode('utf-8')
response = json.loads(response)
response_json = subprocess.check_output(generated_curl_command).decode('utf-8')
response = json.loads(response_json)
assert(response["result"] == "success")
except (AssertionError, Exception):
error_template = """
@@ -100,7 +101,7 @@ To learn more about the test itself, see zerver/openapi/test_curl_examples.py.
file_name=file_name,
line=line,
curl_command=generated_curl_command,
response=json.dumps(response, indent=4)))
response=response_json if response is None else json.dumps(response, indent=4)))
raise
if REGISTERED_GENERATOR_FUNCTIONS != CALLED_GENERATOR_FUNCTIONS: