ruff: Fix C417 Unnecessary `map` usage.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-10-29 20:30:03 -04:00 committed by Tim Abbott
parent ab864be904
commit 3d853caf16
3 changed files with 4 additions and 4 deletions

View File

@ -94,7 +94,7 @@ class Integration:
+ category
+ "' is not a key in CATEGORIES.",
)
self.categories = list(map((lambda c: CATEGORIES[c]), categories))
self.categories = [CATEGORIES[c] for c in categories]
self.logo_path = logo if logo is not None else self.get_logo_path()
# TODO: Enforce that all integrations have logo_url with an assertion.

View File

@ -235,7 +235,7 @@ class MarkdownMiscTest(ZulipTestCase):
lst = get_possible_mentions_info(
mention_backend, {"Fred Flintstone", "Cordelia, LEAR's daughter", "Not A User"}
)
set_of_names = set(map(lambda x: x.full_name.lower(), lst))
set_of_names = {x.full_name.lower() for x in lst}
self.assertEqual(set_of_names, {"fred flintstone", "cordelia, lear's daughter"})
by_id = {row.id: row for row in lst}

View File

@ -5700,8 +5700,8 @@ class GetSubscribersTest(ZulipTestCase):
# It's +1 because of the stream Rome.
self.assert_length(never_sub, len(web_public_streams) + 1)
sub_ids = list(map(lambda stream: stream["stream_id"], sub))
unsub_ids = list(map(lambda stream: stream["stream_id"], unsub))
sub_ids = [stream["stream_id"] for stream in sub]
unsub_ids = [stream["stream_id"] for stream in unsub]
for stream_dict in never_sub:
self.assertTrue(stream_dict["is_web_public"])