diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-11-07 21:19:45 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-11-07 21:19:45 +0000 |
| commit | 201c00bc0837af831f115e8313ad3ccb0be97e7a (patch) | |
| tree | beb7558e95d073b63fa4bb76d830ccaa2de9711a /lib/sqlalchemy/testing/suite | |
| parent | 5b1c9053b0903b2d5a06f82b47fe16a870696ddc (diff) | |
| parent | d050193daaa8d91371c759296f3304b8641c1976 (diff) | |
| download | sqlalchemy-201c00bc0837af831f115e8313ad3ccb0be97e7a.tar.gz | |
Merge "fully implement future engine and remove legacy" into main
Diffstat (limited to 'lib/sqlalchemy/testing/suite')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_dialect.py | 1 | ||||
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_results.py | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_dialect.py b/lib/sqlalchemy/testing/suite/test_dialect.py index 32dfdedad..b3e43aad0 100644 --- a/lib/sqlalchemy/testing/suite/test_dialect.py +++ b/lib/sqlalchemy/testing/suite/test_dialect.py @@ -170,6 +170,7 @@ class AutocommitIsolationTest(fixtures.TablesTest): conn.scalar(select(self.tables.some_table.c.id)), 1 if autocommit else None, ) + conn.rollback() with conn.begin(): conn.execute(self.tables.some_table.delete()) diff --git a/lib/sqlalchemy/testing/suite/test_results.py b/lib/sqlalchemy/testing/suite/test_results.py index c41a55025..f470432d2 100644 --- a/lib/sqlalchemy/testing/suite/test_results.py +++ b/lib/sqlalchemy/testing/suite/test_results.py @@ -323,6 +323,20 @@ class ServerSideCursorsTest( ).exec_driver_sql("select 1") assert self._is_server_side(result.cursor) + # the connection has autobegun, which means at the end of the + # block, we will roll back, which on MySQL at least will fail + # with "Commands out of sync" if the result set + # is not closed, so we close it first. + # + # fun fact! why did we not have this result.close() in this test + # before 2.0? don't we roll back in the connection pool + # unconditionally? yes! and in fact if you run this test in 1.4 + # with stdout shown, there is in fact "Exception during reset or + # similar" with "Commands out sync" emitted a warning! 2.0's + # architecture finds and fixes what was previously an expensive + # silent error condition. + result.close() + def test_stmt_enabled_conn_option_disabled(self): engine = self._fixture(False) |
