Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

test: remove redundant __new__ from _DummyRateLimit test double Fixes #44829 (#45307)

Qurab1b150065603
diff --git a/api/tests/unit_tests/services/test_app_generate_service.py b/api/tests/unit_tests/services/test_app_generate_service.py
index 12f51af15c8..f22f6014342 100644
--- a/api/tests/unit_tests/services/test_app_generate_service.py
+++ b/api/tests/unit_tests/services/test_app_generate_service.py
@@ -50,14 +50,11 @@ Covers:
# Helpers / Fakes
# ---------------------------------------------------------------------------
class _DummyRateLimit:
- """Minimal stand-in for RateLimit that never touches Redis."""
+ """Minimal stand-in for RateLimit that never touches Redis.
- _instance_dict: dict[str, "_DummyRateLimit"] = {}
-
- def __new__(cls, client_id: str, max_active_requests: int):
- # avoid singleton caching across tests
- instance = object.__new__(cls)
- return instance
+ Unlike the real RateLimit, it has no per-client singleton logic, so each
+ call constructs a fresh instance.
+ """
def __init__(self, client_id: str, max_active_requests: int) -> None:
self.client_id = client_id