mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
test_helpers: Remove unused timeout_mock.
We don’t want to encourage more uses of zerver.lib.timeout.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 631c2f7d4c)
This commit is contained in:
committed by
Alex Vandiver
parent
02b80db1dd
commit
607defeba7
@@ -735,18 +735,6 @@ def mock_queue_publish(
|
||||
yield inner
|
||||
|
||||
|
||||
@contextmanager
|
||||
def timeout_mock(mock_path: str) -> Iterator[None]:
|
||||
# timeout() doesn't work in test environment with database operations
|
||||
# and they don't get committed - so we need to replace it with a mock
|
||||
# that just calls the function.
|
||||
def mock_timeout(seconds: int, func: Callable[[], object]) -> object:
|
||||
return func()
|
||||
|
||||
with mock.patch(f"{mock_path}.timeout", new=mock_timeout):
|
||||
yield
|
||||
|
||||
|
||||
@contextmanager
|
||||
def ratelimit_rule(
|
||||
range_seconds: int,
|
||||
|
||||
Reference in New Issue
Block a user