Skip to content

Commit e780e7b

Browse files
committed
along with test cases and installment
1 parent ab9c043 commit e780e7b

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

backend/app/api/routes/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ async def do_create_collection(
190190
vector_store = vector_store_crud.create()
191191
except OpenAIError as err:
192192
callback.fail(str(err))
193-
raise
193+
return
194194

195195
storage = AmazonCloudStorage(current_user)
196196
document_crud = DocumentCrud(session, current_user.id)

backend/app/tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from collections.abc import Generator
22

33
import pytest
4+
import pytest_asyncio
45
from fastapi.testclient import TestClient
56
from sqlmodel import Session, delete
67

@@ -18,6 +19,7 @@
1819
)
1920
from app.tests.utils.user import authentication_token_from_email
2021
from app.tests.utils.utils import get_superuser_token_headers
22+
from httpx import AsyncClient
2123

2224

2325
@pytest.fixture(scope="session", autouse=True)
@@ -42,6 +44,12 @@ def client() -> Generator[TestClient, None, None]:
4244
yield c
4345

4446

47+
@pytest_asyncio.fixture
48+
async def async_client():
49+
async with AsyncClient(app=app, base_url="http://test") as client:
50+
yield client
51+
52+
4553
@pytest.fixture(scope="module")
4654
def superuser_token_headers(client: TestClient) -> dict[str, str]:
4755
return get_superuser_token_headers(client)

backend/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ dependencies = [
3333
[tool.uv]
3434
dev-dependencies = [
3535
"pytest<8.0.0,>=7.4.3",
36+
"pytest-asyncio>=0.21.1,<0.23.0",
3637
"mypy<2.0.0,>=1.8.0",
3738
"ruff<1.0.0,>=0.2.2",
3839
"pre-commit<4.0.0,>=3.6.2",

backend/uv.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)