diff --git a/tests/test_schema.py b/tests/test_schema.py index 83eb348..fa9a476 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -10,9 +10,10 @@ def test_correct_schema(cratedb_service): database = cratedb_service.database tablename = f'"{TESTDRIVE_DATA_SCHEMA}"."foobar"' - inspector: sa.Inspector = sa.inspect(database.engine) + database.run_sql(f"DROP TABLE IF EXISTS {tablename}") database.run_sql(f"CREATE TABLE {tablename} AS SELECT 1") + inspector: sa.Inspector = sa.inspect(database.engine) assert TESTDRIVE_DATA_SCHEMA in inspector.get_schema_names() table_names = inspector.get_table_names(schema=TESTDRIVE_DATA_SCHEMA) diff --git a/tests/vector_test.py b/tests/vector_test.py index 245ed30..6a564d7 100644 --- a/tests/vector_test.py +++ b/tests/vector_test.py @@ -215,13 +215,13 @@ def test_float_vector_as_generic(): assert fv.python_type is list -def test_float_vector_integration(): +def test_float_vector_integration(cratedb_service): """ An integration test for `FLOAT_VECTOR` and `KNN_SEARCH`. """ np = pytest.importorskip("numpy") - engine = sa.create_engine(f"crate://") + engine = cratedb_service.database.engine session = sessionmaker(bind=engine)() Base = declarative_base()