From 8b14704d3586d3fa8445da8589c76b2d7a77a472 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Bodas Date: Thu, 3 Jun 2021 11:14:56 +0530 Subject: [PATCH] test_classes: Fix misplaced `tornado_redirected_to_list` comment. --- zerver/lib/test_classes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py index f9e41decac..9348477795 100644 --- a/zerver/lib/test_classes.py +++ b/zerver/lib/test_classes.py @@ -1272,13 +1272,16 @@ Output: ) -> Iterator[None]: lst.clear() real_event_queue_process_notification = django_tornado_api.process_notification - django_tornado_api.process_notification = lambda notice: lst.append(notice) + # process_notification takes a single parameter called 'notice'. # lst.append takes a single argument called 'object'. # 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 + django_tornado_api.process_notification = lambda notice: lst.append(notice) + yield + django_tornado_api.process_notification = real_event_queue_process_notification self.assert_length(lst, expected_num_events)