summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/fixtures.py2
-rw-r--r--lib/sqlalchemy/testing/suite/test_insert.py24
-rw-r--r--lib/sqlalchemy/testing/suite/test_select.py8
-rw-r--r--lib/sqlalchemy/testing/suite/test_sequence.py8
-rw-r--r--lib/sqlalchemy/testing/suite/test_update_delete.py4
-rw-r--r--lib/sqlalchemy/testing/warnings.py3
6 files changed, 27 insertions, 22 deletions
diff --git a/lib/sqlalchemy/testing/fixtures.py b/lib/sqlalchemy/testing/fixtures.py
index f19b4652a..dcdeee5c9 100644
--- a/lib/sqlalchemy/testing/fixtures.py
+++ b/lib/sqlalchemy/testing/fixtures.py
@@ -396,9 +396,7 @@ def stop_test_class_inside_fixtures(cls):
def after_test():
-
if _fixture_sessions:
-
_close_all_sessions()
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,))
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py
index f8d9b3d88..0d9f08848 100644
--- a/lib/sqlalchemy/testing/suite/test_select.py
+++ b/lib/sqlalchemy/testing/suite/test_select.py
@@ -742,7 +742,7 @@ class PostCompileParamsTest(
with self.sql_execution_asserter() as asserter:
with config.db.connect() as conn:
- conn.execute(stmt, q=10)
+ conn.execute(stmt, dict(q=10))
asserter.assert_(
CursorSQL(
@@ -761,7 +761,7 @@ class PostCompileParamsTest(
with self.sql_execution_asserter() as asserter:
with config.db.connect() as conn:
- conn.execute(stmt, q=[5, 6, 7])
+ conn.execute(stmt, dict(q=[5, 6, 7]))
asserter.assert_(
CursorSQL(
@@ -783,7 +783,7 @@ class PostCompileParamsTest(
with self.sql_execution_asserter() as asserter:
with config.db.connect() as conn:
- conn.execute(stmt, q=[(5, 10), (12, 18)])
+ conn.execute(stmt, dict(q=[(5, 10), (12, 18)]))
asserter.assert_(
CursorSQL(
@@ -807,7 +807,7 @@ class PostCompileParamsTest(
with self.sql_execution_asserter() as asserter:
with config.db.connect() as conn:
- conn.execute(stmt, q=[(5, "z1"), (12, "z3")])
+ conn.execute(stmt, dict(q=[(5, "z1"), (12, "z3")]))
asserter.assert_(
CursorSQL(
diff --git a/lib/sqlalchemy/testing/suite/test_sequence.py b/lib/sqlalchemy/testing/suite/test_sequence.py
index d8c35ed0b..7445ade00 100644
--- a/lib/sqlalchemy/testing/suite/test_sequence.py
+++ b/lib/sqlalchemy/testing/suite/test_sequence.py
@@ -46,11 +46,13 @@ class SequenceTest(fixtures.TablesTest):
)
def test_insert_roundtrip(self, connection):
- connection.execute(self.tables.seq_pk.insert(), data="some data")
+ connection.execute(self.tables.seq_pk.insert(), dict(data="some data"))
self._assert_round_trip(self.tables.seq_pk, connection)
def test_insert_lastrowid(self, connection):
- r = connection.execute(self.tables.seq_pk.insert(), data="some data")
+ r = connection.execute(
+ self.tables.seq_pk.insert(), dict(data="some data")
+ )
eq_(
r.inserted_primary_key, (testing.db.dialect.default_sequence_base,)
)
@@ -62,7 +64,7 @@ class SequenceTest(fixtures.TablesTest):
@requirements.sequences_optional
def test_optional_seq(self, connection):
r = connection.execute(
- self.tables.seq_opt_pk.insert(), data="some data"
+ self.tables.seq_opt_pk.insert(), dict(data="some data")
)
eq_(r.inserted_primary_key, (1,))
diff --git a/lib/sqlalchemy/testing/suite/test_update_delete.py b/lib/sqlalchemy/testing/suite/test_update_delete.py
index f7e6da98e..3fb51ead3 100644
--- a/lib/sqlalchemy/testing/suite/test_update_delete.py
+++ b/lib/sqlalchemy/testing/suite/test_update_delete.py
@@ -32,7 +32,9 @@ class SimpleUpdateDeleteTest(fixtures.TablesTest):
def test_update(self, connection):
t = self.tables.plain_pk
- r = connection.execute(t.update().where(t.c.id == 2), data="d2_new")
+ r = connection.execute(
+ t.update().where(t.c.id == 2), dict(data="d2_new")
+ )
assert not r.is_insert
assert not r.returns_rows
diff --git a/lib/sqlalchemy/testing/warnings.py b/lib/sqlalchemy/testing/warnings.py
index 1b078a263..5699cd035 100644
--- a/lib/sqlalchemy/testing/warnings.py
+++ b/lib/sqlalchemy/testing/warnings.py
@@ -56,9 +56,6 @@ def setup_filters():
# Core execution
#
r"The (?:Executable|Engine)\.(?:execute|scalar)\(\) method",
- r"The connection.execute\(\) method in SQLAlchemy 2.0 will accept "
- "parameters as a single dictionary or a single sequence of "
- "dictionaries only.",
r"The Connection.connect\(\) method is considered legacy",
# r".*DefaultGenerator.execute\(\)",
#