From 16b3c7866772d6635407db4bb56e61bddc50fe35 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 7 Apr 2017 16:58:47 +0200 Subject: [PATCH] Guard against type checking of DefinitionContainer Otherwise it finds that we're trying to set a MagicMock into the definition slot. Contributes to issue CURA-3497. --- tests/Settings/TestGlobalStack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Settings/TestGlobalStack.py b/tests/Settings/TestGlobalStack.py index d1dd5bb2de..69a63d1ca2 100644 --- a/tests/Settings/TestGlobalStack.py +++ b/tests/Settings/TestGlobalStack.py @@ -517,7 +517,8 @@ def test_removeContainer(global_stack): ## Tests setting definitions by specifying an ID of a definition that exists. def test_setDefinitionByIdExists(global_stack, container_registry): - global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID. + with unittest.mock.patch("cura.Settings.CuraContainerStack.DefinitionContainer", unittest.mock.MagicMock): #To guard against type checking the DefinitionContainer. + global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID. ## Tests setting definitions by specifying an ID of a definition that doesn't # exist.