Fix Flake8 errors by using a pytest conftest.py file.

This commit is contained in:
Ryan Dick 2023-10-05 12:11:21 -04:00
parent 7d800e1ce3
commit 9854b244fd
2 changed files with 7 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import pytest
import torch
from invokeai.backend.model_management.models.base import BaseModelType, ModelType, SubModelType
from invokeai.backend.util.test_utils import install_and_load_model, model_installer, slow, torch_device
from invokeai.backend.util.test_utils import install_and_load_model, slow
def build_dummy_sd15_unet_input(torch_device):

6
tests/conftest.py Normal file
View File

@ -0,0 +1,6 @@
# 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 model_installer, torch_device # noqa: F401