From 2f617f56f2acdce00b88f746c403cf5ed66d4d27 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 7 Apr 2020 14:15:43 -0400 Subject: Create initial 2.0 engine implementation Implemented the SQLAlchemy 2 :func:`.future.create_engine` function which is used for forwards compatibility with SQLAlchemy 2. This engine features always-transactional behavior with autobegin. Allow execution options per statement execution. This includes that the before_execute() and after_execute() events now accept an additional dictionary with these options, empty if not passed; a legacy event decorator is added for backwards compatibility which now also emits a deprecation warning. Add some basic tests for execution, transactions, and the new result object. Build out on a new testing fixture that swaps in the future engine completely to start with. Change-Id: I70e7338bb3f0ce22d2f702537d94bb249bd9fb0a Fixes: #4644 --- test/sql/test_sequences.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/sql/test_sequences.py') diff --git a/test/sql/test_sequences.py b/test/sql/test_sequences.py index 8beee514a..1d78c0904 100644 --- a/test/sql/test_sequences.py +++ b/test/sql/test_sequences.py @@ -279,6 +279,11 @@ class SequenceExecTest(fixtures.TestBase): self._assert_seq_result(r.inserted_primary_key[0]) +class FutureSequenceExecTest(fixtures.FutureEngineMixin, SequenceExecTest): + __requires__ = ("sequences",) + __backend__ = True + + class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): __requires__ = ("sequences",) __backend__ = True @@ -396,6 +401,11 @@ class SequenceTest(fixtures.TestBase, testing.AssertsCompiledSQL): eq_(result.inserted_primary_key, [1]) +class FutureSequenceTest(fixtures.FutureEngineMixin, SequenceTest): + __requires__ = ("sequences",) + __backend__ = True + + class TableBoundSequenceTest(fixtures.TablesTest): __requires__ = ("sequences",) __backend__ = True -- cgit v1.2.1