From a4454d5e2052a4a429bcf9e2cf81c124653c0630 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 22 Dec 2022 02:14:40 +0100 Subject: [PATCH] SA20: Fix SqlAlchemyInsertFromSelectTest By binding the insert clause to an engine, use the "qmark" paramstyle again, instead of falling back to the "named" paramstyle of the default dialect. --- src/crate/client/sqlalchemy/tests/insert_from_select_test.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/crate/client/sqlalchemy/tests/insert_from_select_test.py b/src/crate/client/sqlalchemy/tests/insert_from_select_test.py index af8624dd..b4be7005 100644 --- a/src/crate/client/sqlalchemy/tests/insert_from_select_test.py +++ b/src/crate/client/sqlalchemy/tests/insert_from_select_test.py @@ -75,8 +75,7 @@ def test_insert_from_select_triggered(self): ins = insert(self.character_archived).from_select(['name', 'age'], sel) self.session.execute(ins) self.session.commit() - # TODO: Verify if this is correct. self.assertSQL( - "INSERT INTO characters_archive (name, age) SELECT characters.name, characters.age FROM characters WHERE characters.status = :status_1", - ins + "INSERT INTO characters_archive (name, age) SELECT characters.name, characters.age FROM characters WHERE characters.status = ?", + ins.compile(bind=self.engine) )