]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
Support default nullable on identity columns.
authorCaselIT <cfederico87@gmail.com>
Sat, 9 Jan 2021 10:57:46 +0000 (11:57 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 15 Jan 2021 15:40:16 +0000 (10:40 -0500)
This fixes the test for I0516d506ff327cff35cda605e8897a27440e0373

Change-Id: Ief4546fcb7d4d266d0f1f73ed53069dc5cb34fde

tests/test_autogen_render.py

index d2dcc34995e0c19d8a153675f2aff1c449aebcfd..5d26493592b4eb87c433518bc593a2eb6f060880 100644 (file)
@@ -2123,7 +2123,7 @@ class AutogenRenderTest(TestBase):
             % persisted,
         )
 
-    @config.requirements.identity_columns
+    @config.requirements.identity_columns_api
     @testing.combinations(
         ({}, "sa.Identity(always=False)"),
         (dict(always=None), "sa.Identity(always=None)"),
@@ -2148,16 +2148,15 @@ class AutogenRenderTest(TestBase):
         ),
     )
     def test_render_add_column_identity(self, kw, text):
-        op_obj = ops.AddColumnOp(
-            "foo", Column("x", Integer, sa.Identity(**kw))
-        )
+        col = Column("x", Integer, sa.Identity(**kw))
+        op_obj = ops.AddColumnOp("foo", col)
         eq_ignore_whitespace(
             autogenerate.render_op_text(self.autogen_context, op_obj),
             "op.add_column('foo', sa.Column('x', sa.Integer(), "
-            "%s, nullable=True))" % text,
+            "%s, nullable=%r))" % (text, col.nullable),
         )
 
-    @config.requirements.identity_columns
+    @config.requirements.identity_columns_api
     @testing.combinations(
         ({}, "sa.Identity(always=False)"),
         (dict(always=None), "sa.Identity(always=None)"),
@@ -2195,7 +2194,7 @@ class AutogenRenderTest(TestBase):
             "server_default=%s)" % text,
         )
 
-    @config.requirements.identity_columns
+    @config.requirements.identity_columns_api
     def test_render_alter_column_drop_identity(self):
         op_obj = ops.AlterColumnOp(
             "foo",