chore: ran linting

This commit is contained in:
Anish Sarkar 2026-03-21 13:21:19 +05:30
parent de8841fb86
commit e37e6d2d18
19 changed files with 36 additions and 35 deletions

View file

@ -67,7 +67,7 @@ def make_chunk(*, content: str, document_id: int) -> Chunk:
@pytest_asyncio.fixture
async def seed_google_docs(
db_session: AsyncSession, db_user: "User", db_search_space: "SearchSpace"
db_session: AsyncSession, db_user: User, db_search_space: SearchSpace
):
"""Insert a native Drive doc, a legacy Composio Drive doc, and a FILE doc.
@ -269,7 +269,7 @@ def mock_task_logger():
async def seed_connector(
async_engine,
*,
connector_type: "SearchSourceConnectorType",
connector_type: SearchSourceConnectorType,
config: dict,
name_prefix: str = "test",
):

View file

@ -7,7 +7,7 @@ mocked at their system boundaries.
from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
from unittest.mock import MagicMock, patch
import pytest
import pytest_asyncio

View file

@ -8,7 +8,6 @@ which is the foundation of the Google unification changes.
import pytest
from app.config import config as app_config
from app.retriever.chunks_hybrid_search import ChucksHybridSearchRetriever
from .conftest import DUMMY_EMBEDDING

View file

@ -5,11 +5,10 @@ returned ``google.oauth2.credentials.Credentials`` object is correctly
configured with a token and a working refresh handler.
"""
from datetime import datetime, timezone
from datetime import UTC, datetime
from unittest.mock import MagicMock, patch
import pytest
from google.oauth2.credentials import Credentials
pytestmark = pytest.mark.unit
@ -29,7 +28,7 @@ def test_returns_credentials_with_token_and_expiry(MockComposioService):
assert isinstance(creds, Credentials)
assert creds.token == "fake-access-token"
assert creds.expiry is not None
assert creds.expiry > datetime.now(timezone.utc).replace(tzinfo=None)
assert creds.expiry > datetime.now(UTC).replace(tzinfo=None)
@patch("app.services.composio_service.ComposioService")
@ -53,5 +52,5 @@ def test_refresh_handler_fetches_fresh_token(MockComposioService):
new_token, new_expiry = refresh_handler(request=None, scopes=None)
assert new_token == "refreshed-token"
assert new_expiry > datetime.now(timezone.utc).replace(tzinfo=None)
assert new_expiry > datetime.now(UTC).replace(tzinfo=None)
assert mock_service.get_access_token.call_count == 2

View file

@ -10,7 +10,7 @@ allows Composio credentials through without raising ValueError or persisting to
from __future__ import annotations
from datetime import datetime, timedelta, timezone
from datetime import UTC, datetime, timedelta
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
@ -21,7 +21,7 @@ pytestmark = pytest.mark.unit
def _utcnow_naive() -> datetime:
"""Return current UTC time as a naive datetime (matches google-auth convention)."""
return datetime.now(timezone.utc).replace(tzinfo=None)
return datetime.now(UTC).replace(tzinfo=None)
def _composio_credentials(*, expired: bool = False) -> Credentials: