summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/asyncio.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2020-12-03 23:53:47 +0100
committerFederico Caselli <cfederico87@gmail.com>2020-12-08 15:41:23 +0100
commit76d90152302461637cfecb6c0cac65a50975c570 (patch)
tree15a1df7c7b3234bcc1d6ac1d81d44e1d76f21d55 /lib/sqlalchemy/testing/asyncio.py
parent92a12bcc5112ab27357a82e72af98b459af184a7 (diff)
downloadsqlalchemy-76d90152302461637cfecb6c0cac65a50975c570.tar.gz
Detect non compatible execution in async mode
The SQLAlchemy async mode now detects and raises an informative error when an non asyncio compatible :term:`DBAPI` is used. Using a standard ``DBAPI`` with async SQLAlchemy will cause it to block like any sync call, interrupting the executing asyncio loop. Change-Id: I9aed87dc1b0df53e8cb2109495237038aa2cb2d4
Diffstat (limited to 'lib/sqlalchemy/testing/asyncio.py')
-rw-r--r--lib/sqlalchemy/testing/asyncio.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/lib/sqlalchemy/testing/asyncio.py b/lib/sqlalchemy/testing/asyncio.py
deleted file mode 100644
index 2e274de16..000000000
--- a/lib/sqlalchemy/testing/asyncio.py
+++ /dev/null
@@ -1,14 +0,0 @@
-from .assertions import assert_raises as _assert_raises
-from .assertions import assert_raises_message as _assert_raises_message
-from ..util import await_fallback as await_
-from ..util import greenlet_spawn
-
-
-async def assert_raises_async(except_cls, msg, coroutine):
- await greenlet_spawn(_assert_raises, except_cls, await_, coroutine)
-
-
-async def assert_raises_message_async(except_cls, msg, coroutine):
- await greenlet_spawn(
- _assert_raises_message, except_cls, msg, await_, coroutine
- )