summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/fixtures.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-01-15 17:23:52 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-01-15 17:51:34 -0500
commitf898ef162da65a3755d25ee194885677c880c91f (patch)
tree2d45d310f62fd53bb69e73285b2d95f0e2f6c70e /lib/sqlalchemy/testing/fixtures.py
parent5be3c030b321ecc342bf4cd84cbb0838efacd155 (diff)
downloadsqlalchemy-f898ef162da65a3755d25ee194885677c880c91f.tar.gz
run handle error for commit/rollback fail and cancel transaction
Fixed bug in asyncpg dialect where a failure during a "commit" or less likely a "rollback" should cancel the entire transaction; it's no longer possible to emit rollback. Previously the connection would continue to await a rollback that could not succeed as asyncpg would reject it. Fixes: #5824 Change-Id: I5a4916740c269b410f4d1a78ed25191de344b9d0
Diffstat (limited to 'lib/sqlalchemy/testing/fixtures.py')
-rw-r--r--lib/sqlalchemy/testing/fixtures.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index dcdeee5c9..08cab051e 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -107,6 +107,14 @@ class TestBase(object):
engines.testing_reaper._drop_testing_engines("fixture")
@config.fixture()
+ def async_testing_engine(self, testing_engine):
+ def go(**kw):
+ kw["asyncio"] = True
+ return testing_engine(**kw)
+
+ return go
+
+ @config.fixture()
def metadata(self, request):
"""Provide bound MetaData for a single test, dropping afterwards."""