diff --git a/tests/__init__.py b/tests/__init__.py index d37ab141..2498594e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -90,7 +90,9 @@ def copy_and_connect_sqlite_db(input_db, tmp_db, engine_echo): shutil.copyfile(input_db, tmp_db) db_url = f"sqlite:///{tmp_db}" - engine = create_engine(db_url, echo=engine_echo) + engine = create_engine( + db_url, echo=engine_echo, execution_options={"schema_translate_map": {"gis": None}} + ) listen(engine, "connect", load_spatialite) with engine.begin() as connection: print( diff --git a/tests/gallery/test_length_at_insert.py b/tests/gallery/test_length_at_insert.py index 18cbc603..2a484c2a 100644 --- a/tests/gallery/test_length_at_insert.py +++ b/tests/gallery/test_length_at_insert.py @@ -19,7 +19,6 @@ # Tests imports from tests import select -from tests import test_only_with_dialects metadata = MetaData() @@ -32,7 +31,6 @@ ) -@test_only_with_dialects("postgresql") class TestLengthAtInsert: def test_query(self, conn): metadata.drop_all(conn, checkfirst=True) @@ -45,7 +43,7 @@ def test_query(self, conn): ] # Define the query to compute distance (without spheroid) - distance = func.ST_Length(func.ST_GeomFromText(bindparam("ewkt")), False) + distance = func.ST_Length(func.ST_GeomFromEWKT(bindparam("ewkt")), False) i = table.insert() i = i.values(geom=bindparam("ewkt"), distance=distance) diff --git a/tests/test_functional.py b/tests/test_functional.py index 226b40e4..fce5659f 100644 --- a/tests/test_functional.py +++ b/tests/test_functional.py @@ -93,6 +93,22 @@ def test_no_geom_type(self, conn): # Drop the table t.drop(bind=conn) + def test_explicit_schema(self, conn): + # Define the table + t = Table( + "a_table", + MetaData(), + Column("id", Integer, primary_key=True), + Column("geom", Geometry()), + schema="gis", + ) + + # Create the table + t.create(bind=conn) + + # Drop the table + t.drop(bind=conn) + @test_only_with_dialects("postgresql") def test_common_dialect(self, conn, monkeypatch, metadata, Lake): monkeypatch.setattr(conn.dialect, "name", "UNKNOWN DIALECT")