Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Purge queue before starting tests, not at tearDown.

Abhijeet Prasad Bodas9901b72690bc
diff --git a/zerver/tests/test_queue.py b/zerver/tests/test_queue.py
index d41ea684d12..bf7ea4c5eb6 100644
--- a/zerver/tests/test_queue.py
+++ b/zerver/tests/test_queue.py
@@ -103,8 +103,9 @@ class TestQueueImplementation(ZulipTestCase):
assert not message
@override_settings(USING_RABBITMQ=True)
- def tearDown(self) -> None:
+ def setUp(self) -> None:
queue_client = get_queue_client()
assert queue_client.channel
- queue_client.channel.queue_purge("test_suite")
- super().tearDown()
+ if "test_suite" in queue_client.queues:
+ queue_client.channel.queue_purge("test_suite")
+ super().setUp()