summaryrefslogtreecommitdiff
path: root/test/engine/test_parseconnect.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-11-06 15:44:39 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-11-06 15:45:30 -0500
commitf5ed0f5d6e0526a4ee2f9f164b7da79de11a481e (patch)
treea8a8ad00fa55481e176bc3f1cc4dd72e401d8472 /test/engine/test_parseconnect.py
parent8b9772de2dd9c9f1f01f96209d79ec1cd087b2fa (diff)
downloadsqlalchemy-f5ed0f5d6e0526a4ee2f9f164b7da79de11a481e.tar.gz
Support "sqlalchemy.future" for engine_from_config
Added the "future" keyword to the list of words that are known by the :func:`_sa.engine_from_config` function, so that the values "true" and "false" may be configured as "boolean" values when using a key such as ``sqlalchemy.future = true`` or ``sqlalchemy.future = false``. Change-Id: Ib4bba748497cc68e4c913dde54c23a4bb08b4deb
Diffstat (limited to 'test/engine/test_parseconnect.py')
-rw-r--r--test/engine/test_parseconnect.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/engine/test_parseconnect.py b/test/engine/test_parseconnect.py
index b39d5f8ad..22853cf37 100644
--- a/test/engine/test_parseconnect.py
+++ b/test/engine/test_parseconnect.py
@@ -394,6 +394,30 @@ class CreateEngineTest(fixtures.TestBase):
)
assert e.echo is True
+ def test_engine_from_config_future(self):
+ dbapi = mock_dbapi
+
+ config = {
+ "sqlalchemy.url": "postgresql://scott:tiger@somehost/test"
+ "?fooz=somevalue",
+ "sqlalchemy.future": "true",
+ }
+
+ e = engine_from_config(config, module=dbapi, _initialize=False)
+ assert e._is_future
+
+ def test_engine_from_config_not_future(self):
+ dbapi = mock_dbapi
+
+ config = {
+ "sqlalchemy.url": "postgresql://scott:tiger@somehost/test"
+ "?fooz=somevalue",
+ "sqlalchemy.future": "false",
+ }
+
+ e = engine_from_config(config, module=dbapi, _initialize=False)
+ assert not e._is_future
+
def test_pool_reset_on_return_from_config(self):
dbapi = mock_dbapi