mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	test_queue: Use assertLogs to verify warning in test_queue_error_json.
This will avoid spam in test-backend output.
This commit is contained in:
		| @@ -98,8 +98,11 @@ class TestQueueImplementation(ZulipTestCase): | ||||
|             actual_publish(*args, **kwargs) | ||||
|  | ||||
|         with mock.patch("zerver.lib.queue.SimpleQueueClient.publish", | ||||
|                         throw_connection_error_once): | ||||
|                         throw_connection_error_once), self.assertLogs('zulip.queue', level='WARN') as warn_logs: | ||||
|             queue_json_publish("test_suite", {"event": "my_event"}) | ||||
|         self.assertEqual(warn_logs.output, [ | ||||
|             'WARNING:zulip.queue:Failed to send to rabbitmq, trying to reconnect and send again' | ||||
|         ]) | ||||
|  | ||||
|         result = queue_client.json_drain_queue("test_suite") | ||||
|         self.assertEqual(len(result), 1) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user