fix: Resolve test isolation and mypy type checking issues.

- Fix test_database_service.py fixture using wrong attribute name (_db_path instead of _database_path)
- Add proper SQLAlchemy imports (and_, desc) for type-safe query construction
- Replace .desc() method calls with desc() function and col() wrapper
- Fix join condition to use and_() instead of boolean operators
- Fix tuple access in select queries with multiple columns
- All 109 tests passing, mypy clean, no regressions
This commit is contained in:
Elisiário Couto
2025-10-01 00:44:14 +01:00
parent dc7aed316d
commit cecde13486
3 changed files with 457 additions and 558 deletions

View File

@@ -106,6 +106,11 @@ class TestConfigurablePaths:
# Set custom database path
path_manager.set_database_path(test_db_path)
# Initialize database tables for the custom path
from leggen.services.database import init_database
init_database()
# Test database operations using DatabaseService
database_service = DatabaseService()
balance_data = {