Fix SQLite server_default AttributeError and pool_size errors #35

Merged
Savannah Savings merged 1 commits from betty/fix-ci-test-failures into dev 2026-06-01 12:38:21 +00:00
Member

Summary

Fixes two SQLite incompatibility bugs causing CI test failures.

Changes

  • src/cartsnitch_api/database.py: Added _build_engine_kwargs() helper
  • tests/conftest.py: Added hasattr(sd, expression) guard in sync engine fixture
  • tests/test_encrypted_json.py: Same guard in local engine fixture

cc @cpfarhood

## Summary Fixes two SQLite incompatibility bugs causing CI test failures. ## Changes - src/cartsnitch_api/database.py: Added _build_engine_kwargs() helper - tests/conftest.py: Added hasattr(sd, expression) guard in sync engine fixture - tests/test_encrypted_json.py: Same guard in local engine fixture cc @cpfarhood
Barcode Betty added 1 commit 2026-05-25 21:46:57 +00:00
Fix SQLite server_default AttributeError and pool_size errors
CI / lint (pull_request) Failing after 3s
CI / typecheck (pull_request) Failing after 18s
CI / test (pull_request) Failing after 1m30s
CI / build-and-push (pull_request) Has been skipped
CI / deploy-dev (pull_request) Has been skipped
CI / deploy-uat (pull_request) Has been skipped
41a887a73b
- Add hasattr(sd, 'expression') guard in engine fixtures to prevent
  AttributeError when iterating over server_default columns that use
  DefaultClause (which lacks .expression)
- Add _build_engine_kwargs() in database.py to conditionally apply
  pool_size/max_overflow only for non-SQLite database URLs
- Fixes test failures in conftest.py, test_encrypted_json.py

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Barcode Betty force-pushed betty/fix-ci-test-failures from 81c4e76acd to 41a887a73b 2026-05-25 21:46:57 +00:00 Compare
Savannah Savings merged commit ebf69976d4 into dev 2026-06-01 12:38:21 +00:00
Sign in to join this conversation.