mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 15:09:34 +00:00
python: Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our Python code except `zthumbor` and `zulip-ec2-configure-interfaces`, followed by manual indentation fixes. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
fff2d3958a
commit
c734bbd95d
@@ -1,5 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import re
|
||||
import sys
|
||||
import mock
|
||||
@@ -162,7 +160,7 @@ class OpenAPIToolsTest(ZulipTestCase):
|
||||
class OpenAPIArgumentsTest(ZulipTestCase):
|
||||
# This will be filled during test_openapi_arguments:
|
||||
checked_endpoints = set() # type: Set[str]
|
||||
pending_endpoints = set([
|
||||
pending_endpoints = {
|
||||
#### TODO: These endpoints are a priority to document:
|
||||
'/messages/matches_narrow',
|
||||
'/realm/presence',
|
||||
@@ -268,7 +266,7 @@ class OpenAPIArgumentsTest(ZulipTestCase):
|
||||
'/user_groups/{user_group_id}/members',
|
||||
# Regex with an unnamed capturing group.
|
||||
'/users/(?!me/)(?P<email>[^/]*)/presence',
|
||||
])
|
||||
}
|
||||
|
||||
# Endpoints where the documentation is currently failing our
|
||||
# consistency tests. We aim to keep this list empty.
|
||||
@@ -612,9 +610,9 @@ so maybe we shouldn't include it in pending_endpoints.
|
||||
# argument list matches what actually appears in the
|
||||
# codebase.
|
||||
|
||||
openapi_parameter_names = set(
|
||||
[parameter['name'] for parameter in openapi_parameters]
|
||||
)
|
||||
openapi_parameter_names = {
|
||||
parameter['name'] for parameter in openapi_parameters
|
||||
}
|
||||
|
||||
if len(accepted_arguments - openapi_parameter_names) > 0: # nocoverage
|
||||
print("Undocumented parameters for",
|
||||
|
||||
Reference in New Issue
Block a user