From 5f4b406cfe084aa430b7750caa6550d0dc12d6b7 Mon Sep 17 00:00:00 2001 From: Stefan Tobler Date: Fri, 16 Feb 2024 14:10:50 -0500 Subject: [PATCH] updating imports to satisfy ruff --- tests/app/services/bulk_download/test_bulk_download.py | 2 +- tests/conftest.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/app/services/bulk_download/test_bulk_download.py b/tests/app/services/bulk_download/test_bulk_download.py index 3cd2123232..924385f7e1 100644 --- a/tests/app/services/bulk_download/test_bulk_download.py +++ b/tests/app/services/bulk_download/test_bulk_download.py @@ -22,7 +22,7 @@ from invokeai.app.services.invocation_services import InvocationServices from invokeai.app.services.invoker import Invoker from invokeai.app.services.shared.pagination import OffsetPaginatedResults from invokeai.backend.util.logging import InvokeAILogger -from tests.fixtures.event_service import DummyEventService, mock_event_service # noqa: F401,F811 +from tests.fixtures.event_service import DummyEventService from tests.fixtures.sqlite_database import create_mock_sqlite_database diff --git a/tests/conftest.py b/tests/conftest.py index 1c81600229..85fecfe440 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,2 +1,8 @@ # conftest.py is a special pytest file. Fixtures defined in this file will be accessible to all tests in this directory # without needing to explicitly import them. (https://docs.pytest.org/en/6.2.x/fixture.html) + + +# 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