From 7835071981969791015a746e00b49dcf790ee0a8 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Fri, 16 Feb 2024 14:56:49 +0100 Subject: [PATCH] Copy the anchor --- tests/unitary/jupyter/conftest.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/unitary/jupyter/conftest.py b/tests/unitary/jupyter/conftest.py index c41ab23a..4bf17c8c 100644 --- a/tests/unitary/jupyter/conftest.py +++ b/tests/unitary/jupyter/conftest.py @@ -9,10 +9,9 @@ def replace_modules(): mocked_modules = {} - anchor = sys.modules + anchor = sys.modules.copy() def replace(modules: dict): - sys.modules = sys.modules.copy() for module, mock in modules.items(): assert module not in sys.modules sys.modules[module] = mock