From c96ae4c331b3b6277022c5af24d947d90c690a59 Mon Sep 17 00:00:00 2001 From: Martin Kristiansen Date: Thu, 17 Aug 2023 20:55:55 -0400 Subject: [PATCH] Reverting late imports to fix tests --- tests/nodes/test_nodes.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/nodes/test_nodes.py b/tests/nodes/test_nodes.py index f43ad91026..92faa6a0ba 100644 --- a/tests/nodes/test_nodes.py +++ b/tests/nodes/test_nodes.py @@ -1,10 +1,7 @@ from typing import Any, Callable, Literal, Union - from pydantic import Field from invokeai.app.invocations.baseinvocation import BaseInvocation, BaseInvocationOutput, InvocationContext from invokeai.app.invocations.image import ImageField -from invokeai.app.services.events import EventServiceBase -from invokeai.app.services.graph import Edge, EdgeConnection # Define test invocations before importing anything that uses invocations @@ -83,6 +80,11 @@ class PromptCollectionTestInvocation(BaseInvocation): return PromptCollectionTestInvocationOutput(collection=self.collection.copy()) +# Importing these at the top breaks previous tests +from invokeai.app.services.events import EventServiceBase # noqa: E402 +from invokeai.app.services.graph import Edge, EdgeConnection # noqa: E402 + + def create_edge(from_id: str, from_field: str, to_id: str, to_field: str) -> Edge: return Edge( source=EdgeConnection(node_id=from_id, field=from_field),