From 785d9ac61c94e1cd17b6c3fb97e7d467ee058bbc Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 7 Oct 2020 00:50:53 -0400 Subject: [PATCH] limit "no identity" test to a hardcoded dialect this test can't require "skip identity_columns" because older Postgresql and Oracle report false for "identity_columns", but their dialects won't skip actually rendering. for now the only option is to hardcode to a non-identity dialect. Change-Id: Ia4f39f393b4ba10b3e82601a22ab75200cd52909 --- test/sql/test_identity_column.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/test/sql/test_identity_column.py b/test/sql/test_identity_column.py index 0b1bffd000..f99054d629 100644 --- a/test/sql/test_identity_column.py +++ b/test/sql/test_identity_column.py @@ -1,5 +1,3 @@ -import re - from sqlalchemy import Column from sqlalchemy import Identity from sqlalchemy import Integer @@ -153,6 +151,9 @@ class DefaultDialectIdentityDDL(_IdentityDDLFixture, fixtures.TestBase): class NotSupportingIdentityDDL(testing.AssertsCompiledSQL, fixtures.TestBase): + # a dialect that doesn't render IDENTITY + __dialect__ = "sqlite" + @testing.skip_if(testing.requires.identity_columns) def test_identity_is_ignored(self): t = Table( @@ -160,15 +161,8 @@ class NotSupportingIdentityDDL(testing.AssertsCompiledSQL, fixtures.TestBase): MetaData(), Column("foo", Integer(), Identity("always", start=3)), ) - t2 = Table( - "foo_table", - MetaData(), - Column("foo", Integer()), - ) - exp = CreateTable(t2).compile(dialect=testing.db.dialect) self.assert_compile( - CreateTable(t), - re.sub(r"[\n\t]", "", str(exp)), + CreateTable(t), "CREATE TABLE foo_table (foo INTEGER)" ) -- 2.47.3