diff options
Diffstat (limited to 'lib/sqlalchemy/testing/asyncio.py')
-rw-r--r-- | lib/sqlalchemy/testing/asyncio.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/asyncio.py b/lib/sqlalchemy/testing/asyncio.py new file mode 100644 index 000000000..2e274de16 --- /dev/null +++ b/lib/sqlalchemy/testing/asyncio.py @@ -0,0 +1,14 @@ +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 + ) |