test(proxy/batches): default harness prisma_client to None

The batch routing harness left proxy_server.prisma_client at its module
global, which a sibling test in the same shard can leave as a MagicMock.
The unified-file rows that do not opt into managed-file resolution then
entered the resolver and awaited a non-awaitable mock, surfacing as a
503. Patch prisma_client to None by default so those rows stay a no-op;
resolution tests still override it explicitly
This commit is contained in:
Yucheng Zhu 2026-07-24 01:15:02 -07:00
parent 0a33ea40c6
commit f2bb07dffc

View file

@ -198,6 +198,10 @@ def harness():
stack.enter_context(patch.object(proxy_server, "general_settings", {}))
stack.enter_context(patch.object(proxy_server, "proxy_config", MagicMock()))
stack.enter_context(patch.object(proxy_server, "version", "test-version"))
# Default to a database-less proxy so managed-file resolution is a no-op
# unless a test opts in; keeps the routing rows that do not exercise it
# deterministic regardless of cross-file prisma_client pollution.
stack.enter_context(patch.object(proxy_server, "prisma_client", None))
h = Harness(
body=body_holder,