Reverting late imports to fix tests

This commit is contained in:
Martin Kristiansen 2023-08-17 20:55:55 -04:00 committed by psychedelicious
parent ce465acf04
commit c96ae4c331

View File

@ -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),