44
55import pytest
66
7+ from invokeai .app .services .config .invokeai_config import InvokeAIAppConfig
8+
79# This import must happen before other invoke imports or test in other files(!!) break
810from .test_nodes import ( # isort: split
911 ErrorInvocation ,
1416 wait_until ,
1517)
1618
17- from invokeai .app .services .config import InvokeAIAppConfig
1819from invokeai .app .services .graph import Graph , GraphExecutionState , GraphInvocation , LibraryGraph
1920from invokeai .app .services .invocation_cache .invocation_cache_memory import MemoryInvocationCache
2021from invokeai .app .services .invocation_queue import MemoryInvocationQueue
@@ -70,10 +71,10 @@ def mock_services() -> InvocationServices:
7071 graph_execution_manager = graph_execution_manager ,
7172 processor = DefaultInvocationProcessor (),
7273 performance_statistics = InvocationStatsService (graph_execution_manager ),
73- configuration = InvokeAIAppConfig (),
74+ configuration = InvokeAIAppConfig (node_cache_size = 0 ), # type: ignore
7475 session_queue = None , # type: ignore
7576 session_processor = None , # type: ignore
76- invocation_cache = MemoryInvocationCache (),
77+ invocation_cache = MemoryInvocationCache (max_cache_size = 0 ),
7778 )
7879
7980
@@ -102,7 +103,7 @@ def test_can_create_graph_state_from_graph(mock_invoker: Invoker, simple_graph):
102103# @pytest.mark.xfail(reason = "Requires fixing following the model manager refactor")
103104def test_can_invoke (mock_invoker : Invoker , simple_graph ):
104105 g = mock_invoker .create_execution_state (graph = simple_graph )
105- invocation_id = mock_invoker .invoke (queue_item_id = "1" , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g )
106+ invocation_id = mock_invoker .invoke (queue_item_id = 1 , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g )
106107 assert invocation_id is not None
107108
108109 def has_executed_any (g : GraphExecutionState ):
@@ -120,7 +121,7 @@ def has_executed_any(g: GraphExecutionState):
120121def test_can_invoke_all (mock_invoker : Invoker , simple_graph ):
121122 g = mock_invoker .create_execution_state (graph = simple_graph )
122123 invocation_id = mock_invoker .invoke (
123- queue_item_id = "1" , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g , invoke_all = True
124+ queue_item_id = 1 , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g , invoke_all = True
124125 )
125126 assert invocation_id is not None
126127
@@ -140,7 +141,7 @@ def test_handles_errors(mock_invoker: Invoker):
140141 g = mock_invoker .create_execution_state ()
141142 g .graph .add_node (ErrorInvocation (id = "1" ))
142143
143- mock_invoker .invoke (queue_item_id = "1" , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g , invoke_all = True )
144+ mock_invoker .invoke (queue_item_id = 1 , queue_id = DEFAULT_QUEUE_ID , graph_execution_state = g , invoke_all = True )
144145
145146 def has_executed_all (g : GraphExecutionState ):
146147 g = mock_invoker .services .graph_execution_manager .get (g .id )
0 commit comments