summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/testing/suite/test_select.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py
index 2c2317ff7..852bfcf0d 100644
--- a/lib/sqlalchemy/testing/suite/test_select.py
+++ b/lib/sqlalchemy/testing/suite/test_select.py
@@ -1015,7 +1015,16 @@ class IsOrIsNotDistinctFromTest(fixtures.TablesTest):
__backend__ = True
__requires__ = ("supports_is_distinct_from",)
- @testing.provide_metadata
+ @classmethod
+ def define_tables(cls, metadata):
+ Table(
+ "is_distinct_test",
+ metadata,
+ Column("id", Integer, primary_key=True),
+ Column("col_a", Integer, nullable=True),
+ Column("col_b", Integer, nullable=True),
+ )
+
@testing.combinations(
("both_int_different", 0, 1, 1),
("both_int_same", 1, 1, 0),
@@ -1028,15 +1037,8 @@ class IsOrIsNotDistinctFromTest(fixtures.TablesTest):
def test_is_or_isnot_distinct_from(
self, col_a_value, col_b_value, expected_row_count_for_is, connection
):
- meta = self.metadata
- tbl = Table(
- "is_distinct_test",
- meta,
- Column("id", Integer, primary_key=True),
- Column("col_a", Integer, nullable=True),
- Column("col_b", Integer, nullable=True),
- )
- meta.create_all()
+ tbl = self.tables.is_distinct_test
+
connection.execute(
tbl.insert(),
[{"id": 1, "col_a": col_a_value, "col_b": col_b_value}],