Skip to content

Commit f72b1d0

Browse files
authored
Collection: Fixing crawler fixture
1 parent 00ba869 commit f72b1d0

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pytest
2+
from starlette.testclient import TestClient
3+
4+
from app.tests.utils.auth import TestAuthContext
5+
from app.tests.utils.document import WebCrawler
6+
7+
8+
@pytest.fixture
9+
def crawler(client: TestClient, user_api_key: TestAuthContext) -> WebCrawler:
10+
"""Provides a WebCrawler instance for document API testing."""
11+
return WebCrawler(client, user_api_key=user_api_key)

backend/app/tests/api/routes/documents/test_route_document_info.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
DocumentStore,
88
Route,
99
WebCrawler,
10-
crawler,
1110
httpx_to_standard,
1211
)
1312

backend/app/tests/api/routes/documents/test_route_document_list.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
DocumentStore,
77
Route,
88
WebCrawler,
9-
crawler,
109
httpx_to_standard,
1110
)
1211

backend/app/tests/api/routes/documents/test_route_document_permanent_remove.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
from app.core.config import settings
1717
from app.models import Document
1818
from app.tests.utils.document import (
19-
DocumentStore,
2019
DocumentMaker,
20+
DocumentStore,
2121
Route,
2222
WebCrawler,
23-
crawler,
2423
)
2524

2625

backend/app/tests/utils/document.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from dataclasses import dataclass
88
from urllib.parse import ParseResult, urlunparse
99

10-
import pytest
1110
from httpx import Response
1211
from sqlmodel import Session, delete
1312
from fastapi.testclient import TestClient
@@ -164,8 +163,3 @@ def to_public_dict(self) -> dict:
164163
result[field] = self.to_string(value)
165164

166165
return result
167-
168-
169-
@pytest.fixture
170-
def crawler(client: TestClient, user_api_key: TestAuthContext) -> WebCrawler:
171-
return WebCrawler(client, user_api_key=user_api_key)

0 commit comments

Comments
 (0)