From: Mike Bayer Date: Wed, 7 Oct 2020 04:50:53 +0000 (-0400) Subject: limit "no identity" test to a hardcoded dialect X-Git-Tag: rel_1_4_0b1~51^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=785d9ac61c94e1cd17b6c3fb97e7d467ee058bbc;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git 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 --- 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)" )