summaryrefslogtreecommitdiff
path: root/test/ext/asyncio/test_engine_py3k.py
diff options
context:
space:
mode:
authorNils Philippsen <nils@tiptoe.de>2021-11-13 11:11:32 -0500
committerFederico Caselli <cfederico87@gmail.com>2021-12-10 17:20:31 +0100
commit98b1650efce79ae6d304eb08047890ef8ae89df1 (patch)
tree290ad5959858679b1b810a047fc54b4eafc070d4 /test/ext/asyncio/test_engine_py3k.py
parent9d837b02b5eb42385281b88d09fe2aeea0376ca9 (diff)
downloadsqlalchemy-98b1650efce79ae6d304eb08047890ef8ae89df1.tar.gz
Add async_engine_from_config()
Added :func:`_asyncio.async_engine_config` function to create an async engine from a configuration dict. This otherwise behaves the same as :func:`_sa.engine_from_config`. Fixes: #7301 Closes: #7302 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7302 Pull-request-sha: c7c758833b6c37b7509b8c5bed4f26ac0ccc0395 Change-Id: I64feadf95b5015c24fe0fa0dbae6755b72d1713e
Diffstat (limited to 'test/ext/asyncio/test_engine_py3k.py')
-rw-r--r--test/ext/asyncio/test_engine_py3k.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ext/asyncio/test_engine_py3k.py b/test/ext/asyncio/test_engine_py3k.py
index c65a51bf7..7e680bd0e 100644
--- a/test/ext/asyncio/test_engine_py3k.py
+++ b/test/ext/asyncio/test_engine_py3k.py
@@ -14,6 +14,7 @@ from sqlalchemy import Table
from sqlalchemy import testing
from sqlalchemy import text
from sqlalchemy import union_all
+from sqlalchemy.ext.asyncio import async_engine_from_config
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy.ext.asyncio import engine as _async_engine
from sqlalchemy.ext.asyncio import exc as asyncio_exc
@@ -588,6 +589,16 @@ class AsyncEngineTest(EngineFixture):
server_side_cursors=True,
)
+ def test_async_engine_from_config(self):
+ config = {
+ "sqlalchemy.url": str(testing.db.url),
+ "sqlalchemy.echo": "true",
+ }
+ engine = async_engine_from_config(config)
+ assert engine.url == testing.db.url
+ assert engine.echo is True
+ assert engine.dialect.is_async is True
+
class AsyncEventTest(EngineFixture):
"""The engine events all run in their normal synchronous context.