From f898ef162da65a3755d25ee194885677c880c91f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 15 Jan 2021 17:23:52 -0500 Subject: 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 --- lib/sqlalchemy/testing/fixtures.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/sqlalchemy/testing') 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 @@ -106,6 +106,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.""" -- cgit v1.2.1