Skip to content

Commit ce0bc3b

Browse files
committed
fix: force the psycopg2 driver in the acceptance tests database URL, which defaults to psycopg now
SQLAlchemy 2.1.0 makes psycopg 3 the default driver for postgresql:// URLs. This package installs psycopg2-binary only, and since that release every acceptance test needing the database errors out at setup with "ModuleNotFoundError: No module named 'psycopg'" wherever SQLAlchemy is not pinned, as in the published wheel. The engine URL now names the psycopg2 driver explicitly, which keeps the tests on the installed driver with any SQLAlchemy 2.x release. on-behalf-of: @camptocamp <info@camptocamp.com>
1 parent 250c038 commit ce0bc3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎geoserver_acceptance_tests/tests/conftest.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def engine(config: dict) -> Generator[sqlalchemy.Engine, None, None]:
7070
password = config["db"]["pg_password"]
7171
database = config["db"]["pg_db"]
7272
yield sqlalchemy.create_engine(
73-
f"postgresql://{user}:{password}@{host}:{port}/{database}",
73+
f"postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}",
7474
)
7575

7676

0 commit comments

Comments
 (0)