mirror of
https://github.com/mruwnik/memory.git
synced 2025-06-08 13:24:41 +02:00
skip db tests when no db
This commit is contained in:
parent
cf98d38bb8
commit
743a76c3d1
@ -9,6 +9,7 @@ import pytest
|
|||||||
import qdrant_client
|
import qdrant_client
|
||||||
import voyageai
|
import voyageai
|
||||||
from sqlalchemy import create_engine, text
|
from sqlalchemy import create_engine, text
|
||||||
|
from sqlalchemy.exc import OperationalError
|
||||||
from sqlalchemy.orm import sessionmaker
|
from sqlalchemy.orm import sessionmaker
|
||||||
from testcontainers.qdrant import QdrantContainer
|
from testcontainers.qdrant import QdrantContainer
|
||||||
|
|
||||||
@ -98,7 +99,10 @@ def test_db():
|
|||||||
test_db_name = get_test_db_name()
|
test_db_name = get_test_db_name()
|
||||||
|
|
||||||
# Create test database
|
# Create test database
|
||||||
test_db_url = create_test_database(test_db_name)
|
try:
|
||||||
|
test_db_url = create_test_database(test_db_name)
|
||||||
|
except OperationalError as e:
|
||||||
|
pytest.skip(f"Failed to create test database: {e}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
run_alembic_migrations(test_db_name)
|
run_alembic_migrations(test_db_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user