summaryrefslogtreecommitdiff
path: root/test/dialect/test_sqlite.py
diff options
context:
space:
mode:
authorYongJieYongJie <KhooYongJie@gmx.com>2021-04-28 13:30:09 -0400
committerFederico Caselli <cfederico87@gmail.com>2021-04-28 20:52:34 +0200
commit1ee6332ba261cc1b6bbc8f427d17f81614b07d9b (patch)
tree3bdb6554999b6e7275b27734d73b30e9323b337b /test/dialect/test_sqlite.py
parent7fdaac7b2910b5612420378519b9f60d4649daff (diff)
downloadsqlalchemy-1ee6332ba261cc1b6bbc8f427d17f81614b07d9b.tar.gz
Use SingletonThreadPool for in-memory SQLite
database created using filename uri Default to using ``SingletonThreadPool`` for in-memory SQLite databases created using URI filenames. Previously the default pool used was the ``NullPool`` that precented sharing the same database between multiple engines. Fixes: #6379 Closes: #6380 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6380 Pull-request-sha: 3b8024417a3a54c8269d43e40801aa4e58593540 Change-Id: Ice09622796455e796ede7711c98f3ceec13aa949
Diffstat (limited to 'test/dialect/test_sqlite.py')
-rw-r--r--test/dialect/test_sqlite.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py
index 7fd7ac333..bae97bb9a 100644
--- a/test/dialect/test_sqlite.py
+++ b/test/dialect/test_sqlite.py
@@ -710,6 +710,11 @@ class DialectTest(
e = create_engine("sqlite+pysqlite:///:memory:")
assert e.pool.__class__ is pool.SingletonThreadPool
+ e = create_engine(
+ "sqlite+pysqlite:///file:foo.db?mode=memory&uri=true"
+ )
+ assert e.pool.__class__ is pool.SingletonThreadPool
+
e = create_engine("sqlite+pysqlite:///foo.db")
assert e.pool.__class__ is pool.NullPool