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:
Anders Kaseorg
2024-04-18 10:40:05 -07:00
committed by Alex Vandiver
parent 02b80db1dd
commit 607defeba7

View File

@@ -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,