mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
relocating event_service fixture due to import ordering
This commit is contained in:
parent
b5a9ed351d
commit
0ab9fe6987
@ -46,6 +46,12 @@ def mock_image_dto() -> ImageDTO:
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_event_service() -> DummyEventService:
|
||||
"""Create a dummy event service."""
|
||||
return DummyEventService()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_services(mock_event_service: DummyEventService) -> InvocationServices:
|
||||
configuration = InvokeAIAppConfig(use_memory_db=True, node_cache_size=0)
|
||||
|
@ -5,4 +5,3 @@
|
||||
# We import the model_installer and torch_device fixtures here so that they can be used by all tests. Flake8 does not
|
||||
# play well with fixtures (F401 and F811), so this is cleaner than importing in all files that use these fixtures.
|
||||
from invokeai.backend.util.test_utils import torch_device # noqa: F401
|
||||
from tests.fixtures.event_service import mock_event_service # noqa: F401
|
||||
|
7
tests/fixtures/event_service.py
vendored
7
tests/fixtures/event_service.py
vendored
@ -1,6 +1,5 @@
|
||||
from typing import Any, Dict, List
|
||||
|
||||
import pytest
|
||||
from pydantic import BaseModel
|
||||
|
||||
from invokeai.app.services.events.events_base import EventServiceBase
|
||||
@ -26,9 +25,3 @@ class DummyEventService(EventServiceBase):
|
||||
def dispatch(self, event_name: str, payload: Any) -> None:
|
||||
"""Dispatch an event by appending it to self.events."""
|
||||
self.events.append(DummyEvent(event_name=payload["event"], payload=payload["data"]))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_event_service() -> DummyEventService:
|
||||
"""Create a dummy event service."""
|
||||
return DummyEventService()
|
||||
|
Loading…
Reference in New Issue
Block a user