ruff: Fix PLW0108 Lambda may be unnecessary.

This is a preview rule, not yet enabled by default.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2024-02-29 17:56:37 -08:00
committed by Tim Abbott
parent 553f268b04
commit d748ec8d52
11 changed files with 17 additions and 19 deletions

View File

@@ -1971,9 +1971,7 @@ class ZulipTestCase(ZulipTestCaseMixin, TestCase):
# Some code might call process_notification using keyword arguments,
# so mypy doesn't allow assigning lst.append to process_notification
# So explicitly change parameter name to 'notice' to work around this problem
with mock.patch(
"zerver.tornado.event_queue.process_notification", lambda notice: lst.append(notice)
):
with mock.patch("zerver.tornado.event_queue.process_notification", lst.append):
# Some `send_event` calls need to be executed only after the current transaction
# commits (using `on_commit` hooks). Because the transaction in Django tests never
# commits (rather, gets rolled back after the test completes), such events would