mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
chore(ml): improve shutdown (#5689)
This commit is contained in:
parent
9768931275
commit
d729c863c8
4 changed files with 80 additions and 48 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterator
|
||||
from unittest import mock
|
||||
|
||||
|
|
@ -8,7 +7,7 @@ import pytest
|
|||
from fastapi.testclient import TestClient
|
||||
from PIL import Image
|
||||
|
||||
from .main import app, init_state
|
||||
from .main import app
|
||||
from .schemas import ndarray_f32
|
||||
|
||||
|
||||
|
|
@ -29,9 +28,9 @@ def mock_get_model() -> Iterator[mock.Mock]:
|
|||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def deployed_app() -> TestClient:
|
||||
init_state()
|
||||
return TestClient(app)
|
||||
def deployed_app() -> Iterator[TestClient]:
|
||||
with TestClient(app) as client:
|
||||
yield client
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue