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 /test/sql/test_defaults.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 'test/sql/test_defaults.py')
| -rw-r--r-- | test/sql/test_defaults.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/sql/test_defaults.py b/test/sql/test_defaults.py index 0a50a6356..fd5aec503 100644 --- a/test/sql/test_defaults.py +++ b/test/sql/test_defaults.py @@ -1446,11 +1446,12 @@ class InsertFromSelectTest(fixtures.TablesTest): Table("data", metadata, Column("x", Integer), Column("y", Integer)) @classmethod - def insert_data(cls): + def insert_data(cls, connection): data = cls.tables.data - with testing.db.connect() as conn: - conn.execute(data.insert(), [{"x": 2, "y": 5}, {"x": 7, "y": 12}]) + connection.execute( + data.insert(), [{"x": 2, "y": 5}, {"x": 7, "y": 12}] + ) @testing.provide_metadata def test_insert_from_select_override_defaults(self, connection): |
