]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
turn off pyodbc pooling
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 11 Aug 2024 19:41:36 +0000 (15:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 Aug 2024 13:33:55 +0000 (09:33 -0400)
new updates of unixodbc are turning this on in CI revealing
that our isolation level tests assume no pooling takes place,
so disable this, which is only at global module level for pyodbc

Change-Id: I971dfddc90d248281e8ca8677a3a41af6de28b86
(cherry picked from commit 896dbdb5920ffb645a8948c254f73dd0fcb0d3c0)

lib/sqlalchemy/dialects/mssql/provision.py
lib/sqlalchemy/testing/provision.py

index dd001da2467e5bb9ede811907d7ebaabdd0243a6..20c39f0d11f0935294f9556c16a6a3d1bb1158f5 100644 (file)
@@ -18,10 +18,17 @@ from ...testing.provision import drop_all_schema_objects_pre_tables
 from ...testing.provision import drop_db
 from ...testing.provision import get_temp_table_name
 from ...testing.provision import log
+from ...testing.provision import post_configure_engine
 from ...testing.provision import run_reap_dbs
 from ...testing.provision import temp_table_keyword_args
 
 
+@post_configure_engine.for_db("mssql")
+def post_configure_engine(url, engine, follower_ident):
+    if engine.driver == "pyodbc":
+        engine.dialect.dbapi.pooling = False
+
+
 @create_db.for_db("mssql")
 def _mssql_create_db(cfg, eng, ident):
     with eng.connect().execution_options(isolation_level="AUTOCOMMIT") as conn:
index 56c1be2518a9d0d76c53a646c9f2c58c26d9b015..eea9c66dbca64b77d98df962680a881366e68e9b 100644 (file)
@@ -314,7 +314,7 @@ def update_db_opts(db_url, db_opts):
 def post_configure_engine(url, engine, follower_ident):
     """Perform extra steps after configuring an engine for testing.
 
-    (For the internal dialects, currently only used by sqlite, oracle)
+    (For the internal dialects, currently only used by sqlite, oracle, mssql)
     """
     pass