From: Gord Thompson Date: Fri, 9 Dec 2022 16:55:34 +0000 (-0700) Subject: Specify view columns in HasTableTest X-Git-Tag: rel_2_0_0rc1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e9b1450b6899c82c9362cbc92fcc0f01c97b043;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Specify view columns in HasTableTest Fixes: #8960 Avoid test errors on databases that do not support CREATE VIEW vv AS SELECT * FROM Change-Id: Ic9e892aa4466030b9b325c11228dad15cf59a258 --- diff --git a/lib/sqlalchemy/testing/suite/test_reflection.py b/lib/sqlalchemy/testing/suite/test_reflection.py index 60f8fabf17..2550eff4e8 100644 --- a/lib/sqlalchemy/testing/suite/test_reflection.py +++ b/lib/sqlalchemy/testing/suite/test_reflection.py @@ -88,15 +88,18 @@ class HasTableTest(OneConnectionTablesTest): @classmethod def define_views(cls, metadata): - query = "CREATE VIEW vv AS SELECT * FROM test_table" + query = "CREATE VIEW vv AS SELECT id, data FROM test_table" event.listen(metadata, "after_create", DDL(query)) event.listen(metadata, "before_drop", DDL("DROP VIEW vv")) if testing.requires.schemas.enabled: - query = "CREATE VIEW %s.vv AS SELECT * FROM %s.test_table_s" % ( - config.test_schema, - config.test_schema, + query = ( + "CREATE VIEW %s.vv AS SELECT id, data FROM %s.test_table_s" + % ( + config.test_schema, + config.test_schema, + ) ) event.listen(metadata, "after_create", DDL(query)) event.listen(