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.

test_helpers: Remove unused timeout_mock.

Anders Kaseorg631c2f7d4cd0
diff --git a/zerver/lib/test_helpers.py b/zerver/lib/test_helpers.py
index 917a31e85c2..ef46e0acbe7 100644
--- a/zerver/lib/test_helpers.py
+++ b/zerver/lib/test_helpers.py
@@ -736,18 +736,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,