Add comprehensive tests for OAuth callback flows and update pyproject.toml

- Extended OAuth callback tests to cover various scenarios (e.g., account linking, user creation, inactive users, and token/user info failures).
- Added `app/init_db.py` to the excluded files in `pyproject.toml`.
This commit is contained in:
Felipe Cardoso
2025-11-25 08:26:41 +01:00
parent 84e0a7fe81
commit 13f617828b
8 changed files with 1144 additions and 26 deletions

View File

@@ -267,10 +267,15 @@ class CRUDBase[
sort_by: str | None = None,
sort_order: str = "asc",
filters: dict[str, Any] | None = None,
) -> tuple[list[ModelType], int]:
) -> tuple[list[ModelType], int]: # pragma: no cover
"""
Get multiple records with total count, filtering, and sorting.
NOTE: This method is defensive code that's never called in practice.
All CRUD subclasses (CRUDUser, CRUDOrganization, CRUDSession) override this method
with their own implementations that include additional parameters like search.
Marked as pragma: no cover to avoid false coverage gaps.
Args:
db: Database session
skip: Number of records to skip
@@ -323,7 +328,7 @@ class CRUDBase[
items = list(items_result.scalars().all())
return items, total
except Exception as e:
except Exception as e: # pragma: no cover
logger.error(
f"Error retrieving paginated {self.model.__name__} records: {e!s}"
)