summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/suite/test_insert.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-01-06 10:43:19 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-01-15 13:04:58 -0500
commitebbbac0a76b3327a829864afb26ee1b7ff1dc780 (patch)
treeb086b06760255bc0bb76e51624a5e3772bc4cc3d /lib/sqlalchemy/testing/suite/test_insert.py
parent6be06d85e598e4fda6f3d35084e1c5cccb30cee5 (diff)
downloadsqlalchemy-ebbbac0a76b3327a829864afb26ee1b7ff1dc780.tar.gz
update execute() arg formats in modules and tests
continuing with producing a SQLAlchemy 1.4.0b2 that internally does not emit any of its own 2.0 deprecation warnings, migrate the *args and **kwargs passed to execute() methods that now must be a single list or dictionary. Alembic 1.5 is again waiting on this internal consistency to be present so that it can pass all tests with no 2.0 deprecation warnings. Change-Id: If6b792e57c8c5dff205419644ab68e631575a2fa
Diffstat (limited to 'lib/sqlalchemy/testing/suite/test_insert.py')
-rw-r--r--lib/sqlalchemy/testing/suite/test_insert.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_insert.py b/lib/sqlalchemy/testing/suite/test_insert.py
index da59d831f..35f3315c7 100644
--- a/lib/sqlalchemy/testing/suite/test_insert.py
+++ b/lib/sqlalchemy/testing/suite/test_insert.py
@@ -51,13 +51,15 @@ class LastrowidTest(fixtures.TablesTest):
def test_autoincrement_on_insert(self, connection):
- connection.execute(self.tables.autoinc_pk.insert(), data="some data")
+ connection.execute(
+ self.tables.autoinc_pk.insert(), dict(data="some data")
+ )
self._assert_round_trip(self.tables.autoinc_pk, connection)
def test_last_inserted_id(self, connection):
r = connection.execute(
- self.tables.autoinc_pk.insert(), data="some data"
+ self.tables.autoinc_pk.insert(), dict(data="some data")
)
pk = connection.scalar(select(self.tables.autoinc_pk.c.id))
eq_(r.inserted_primary_key, (pk,))
@@ -65,7 +67,7 @@ class LastrowidTest(fixtures.TablesTest):
@requirements.dbapi_lastrowid
def test_native_lastrowid_autoinc(self, connection):
r = connection.execute(
- self.tables.autoinc_pk.insert(), data="some data"
+ self.tables.autoinc_pk.insert(), dict(data="some data")
)
lastrowid = r.lastrowid
pk = connection.scalar(select(self.tables.autoinc_pk.c.id))
@@ -116,7 +118,9 @@ class InsertBehaviorTest(fixtures.TablesTest):
engine = config.db
with engine.begin() as conn:
- r = conn.execute(self.tables.autoinc_pk.insert(), data="some data")
+ r = conn.execute(
+ self.tables.autoinc_pk.insert(), dict(data="some data")
+ )
assert r._soft_closed
assert not r.closed
assert r.is_insert
@@ -131,7 +135,7 @@ class InsertBehaviorTest(fixtures.TablesTest):
@requirements.returning
def test_autoclose_on_insert_implicit_returning(self, connection):
r = connection.execute(
- self.tables.autoinc_pk.insert(), data="some data"
+ self.tables.autoinc_pk.insert(), dict(data="some data")
)
assert r._soft_closed
assert not r.closed
@@ -315,7 +319,7 @@ class ReturningTest(fixtures.TablesTest):
def test_explicit_returning_pk_autocommit(self, connection):
table = self.tables.autoinc_pk
r = connection.execute(
- table.insert().returning(table.c.id), data="some data"
+ table.insert().returning(table.c.id), dict(data="some data")
)
pk = r.first()[0]
fetched_pk = connection.scalar(select(table.c.id))
@@ -324,7 +328,7 @@ class ReturningTest(fixtures.TablesTest):
def test_explicit_returning_pk_no_autocommit(self, connection):
table = self.tables.autoinc_pk
r = connection.execute(
- table.insert().returning(table.c.id), data="some data"
+ table.insert().returning(table.c.id), dict(data="some data")
)
pk = r.first()[0]
fetched_pk = connection.scalar(select(table.c.id))
@@ -332,13 +336,15 @@ class ReturningTest(fixtures.TablesTest):
def test_autoincrement_on_insert_implicit_returning(self, connection):
- connection.execute(self.tables.autoinc_pk.insert(), data="some data")
+ connection.execute(
+ self.tables.autoinc_pk.insert(), dict(data="some data")
+ )
self._assert_round_trip(self.tables.autoinc_pk, connection)
def test_last_inserted_id_implicit_returning(self, connection):
r = connection.execute(
- self.tables.autoinc_pk.insert(), data="some data"
+ self.tables.autoinc_pk.insert(), dict(data="some data")
)
pk = connection.scalar(select(self.tables.autoinc_pk.c.id))
eq_(r.inserted_primary_key, (pk,))