diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-04-14 15:30:28 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-04-15 11:12:59 -0400 |
| commit | 8725d89abaf1a6ce870e71fbf1a4962dc4899204 (patch) | |
| tree | d9a52a8e960a3ec087a5bda1cf03b498b945d162 /lib/sqlalchemy/testing/suite/test_update_delete.py | |
| parent | f39cf13680a0ee5b190d498d29ea31c76f546dfb (diff) | |
| download | sqlalchemy-8725d89abaf1a6ce870e71fbf1a4962dc4899204.tar.gz | |
Pass connection to TablesTest.insert_data()
towards the goal of reducing verbosity and repetition
in test fixtures as well as that we are moving to
connection only for execution, move the insert_data()
classmethod to accept a connection and adjust all
fixtures to use it.
Change-Id: I3bf534acca0d5f4cda1d4da8ae91f1155b829b09
Diffstat (limited to 'lib/sqlalchemy/testing/suite/test_update_delete.py')
| -rw-r--r-- | lib/sqlalchemy/testing/suite/test_update_delete.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_update_delete.py b/lib/sqlalchemy/testing/suite/test_update_delete.py index 6003a0994..f7e6da98e 100644 --- a/lib/sqlalchemy/testing/suite/test_update_delete.py +++ b/lib/sqlalchemy/testing/suite/test_update_delete.py @@ -1,4 +1,3 @@ -from .. import config from .. import fixtures from ..assertions import eq_ from ..schema import Column @@ -21,16 +20,15 @@ class SimpleUpdateDeleteTest(fixtures.TablesTest): ) @classmethod - def insert_data(cls): - with config.db.connect() as conn: - conn.execute( - cls.tables.plain_pk.insert(), - [ - {"id": 1, "data": "d1"}, - {"id": 2, "data": "d2"}, - {"id": 3, "data": "d3"}, - ], - ) + def insert_data(cls, connection): + connection.execute( + cls.tables.plain_pk.insert(), + [ + {"id": 1, "data": "d1"}, + {"id": 2, "data": "d2"}, + {"id": 3, "data": "d3"}, + ], + ) def test_update(self, connection): t = self.tables.plain_pk |
