summaryrefslogtreecommitdiff
path: root/test/sql/test_defaults.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-04-07 14:15:43 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-04-16 13:35:55 -0400
commit2f617f56f2acdce00b88f746c403cf5ed66d4d27 (patch)
tree0962f2c43c1a361135ecdab933167fa0963ae58a /test/sql/test_defaults.py
parentbd303b10e2bf69169f07447c7272fc71ac931f10 (diff)
downloadsqlalchemy-2f617f56f2acdce00b88f746c403cf5ed66d4d27.tar.gz
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
Diffstat (limited to 'test/sql/test_defaults.py')
-rw-r--r--test/sql/test_defaults.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py
index fd5aec503..7352810ae 100644
--- a/test/sql/test_defaults.py
+++ b/test/sql/test_defaults.py
@@ -535,7 +535,7 @@ class DefaultRoundTripTest(fixtures.TablesTest):
result = connection.execute(t.select().order_by(t.c.col1))
today = datetime.date.today()
eq_(
- result.fetchall(),
+ list(result),
[
(
x,
@@ -715,9 +715,11 @@ class DefaultRoundTripTest(fixtures.TablesTest):
"group 1",
connection.execute,
t.insert(),
- {"col4": 7, "col7": 12, "col8": 19},
- {"col4": 7, "col8": 19},
- {"col4": 7, "col7": 12, "col8": 19},
+ [
+ {"col4": 7, "col7": 12, "col8": 19},
+ {"col4": 7, "col8": 19},
+ {"col4": 7, "col7": 12, "col8": 19},
+ ],
)
def test_insert_values(self, connection):
@@ -834,6 +836,13 @@ class DefaultRoundTripTest(fixtures.TablesTest):
eq_(55, row._mapping["col3"])
+class FutureDefaultRoundTripTest(
+ fixtures.FutureEngineMixin, DefaultRoundTripTest
+):
+
+ __backend__ = True
+
+
class CTEDefaultTest(fixtures.TablesTest):
__requires__ = ("ctes", "returning", "ctes_on_dml")
__backend__ = True