From 5a0e25f3748da82df70f2d3ffa7bb51959d23e13 Mon Sep 17 00:00:00 2001 From: "artur.shiriev" Date: Fri, 11 Oct 2024 14:55:09 +0300 Subject: [PATCH] prevent sharing context --- that_depends/providers/context_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/that_depends/providers/context_resources.py b/that_depends/providers/context_resources.py index 69687a7..3ec061e 100644 --- a/that_depends/providers/context_resources.py +++ b/that_depends/providers/context_resources.py @@ -52,7 +52,7 @@ async def __aenter__(self) -> ContextType: return self._enter() def _enter(self) -> ContextType: - self._context_token = _CONTAINER_CONTEXT.set(self._initial_context or {}) + self._context_token = _CONTAINER_CONTEXT.set({**self._initial_context}) return _CONTAINER_CONTEXT.get() def __exit__(