mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
test_runner: Move bounce_key_prefix_for_testing to ZulipTestCase.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
768e8ccc55
commit
e40cdc6c2c
@@ -32,7 +32,9 @@ from zerver.lib.actions import (
|
|||||||
check_send_stream_message,
|
check_send_stream_message,
|
||||||
gather_subscriptions,
|
gather_subscriptions,
|
||||||
)
|
)
|
||||||
|
from zerver.lib.cache import bounce_key_prefix_for_testing
|
||||||
from zerver.lib.initial_password import initial_password
|
from zerver.lib.initial_password import initial_password
|
||||||
|
from zerver.lib.rate_limiter import bounce_redis_key_prefix_for_testing
|
||||||
from zerver.lib.sessions import get_session_dict_user
|
from zerver.lib.sessions import get_session_dict_user
|
||||||
from zerver.lib.stream_subscription import get_stream_subscriptions_for_user
|
from zerver.lib.stream_subscription import get_stream_subscriptions_for_user
|
||||||
from zerver.lib.streams import (
|
from zerver.lib.streams import (
|
||||||
@@ -93,6 +95,10 @@ class ZulipTestCase(TestCase):
|
|||||||
super().setUp()
|
super().setUp()
|
||||||
self.API_KEYS: Dict[str, str] = {}
|
self.API_KEYS: Dict[str, str] = {}
|
||||||
|
|
||||||
|
test_name = self.id()
|
||||||
|
bounce_key_prefix_for_testing(test_name)
|
||||||
|
bounce_redis_key_prefix_for_testing(test_name)
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self) -> None:
|
||||||
super().tearDown()
|
super().tearDown()
|
||||||
# Important: we need to clear event queues to avoid leaking data to future tests.
|
# Important: we need to clear event queues to avoid leaking data to future tests.
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ from scripts.lib.zulip_tools import (
|
|||||||
get_or_create_dev_uuid_var_path,
|
get_or_create_dev_uuid_var_path,
|
||||||
)
|
)
|
||||||
from zerver.lib import test_helpers
|
from zerver.lib import test_helpers
|
||||||
from zerver.lib.cache import bounce_key_prefix_for_testing
|
|
||||||
from zerver.lib.rate_limiter import bounce_redis_key_prefix_for_testing
|
|
||||||
from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection
|
from zerver.lib.sqlalchemy_utils import get_sqlalchemy_connection
|
||||||
from zerver.lib.test_helpers import append_instrumentation_data, write_instrumentation_reports
|
from zerver.lib.test_helpers import append_instrumentation_data, write_instrumentation_reports
|
||||||
|
|
||||||
@@ -48,10 +46,6 @@ _worker_id = 0 # Used to identify the worker process.
|
|||||||
|
|
||||||
def run_test(test: TestCase, result: TestResult) -> bool:
|
def run_test(test: TestCase, result: TestResult) -> bool:
|
||||||
failed = False
|
failed = False
|
||||||
test_name = test.id()
|
|
||||||
|
|
||||||
bounce_key_prefix_for_testing(test_name)
|
|
||||||
bounce_redis_key_prefix_for_testing(test_name)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
test._pre_setup()
|
test._pre_setup()
|
||||||
|
|||||||
Reference in New Issue
Block a user