MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / test_on_null

Method test_on_null

test/sql/test_identity_column.py:160–178  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158 __requires__ = ("identity_columns_standard",)
159
160 def test_on_null(self):
161 t = Table(
162 "foo_table",
163 MetaData(),
164 Column(
165 "foo",
166 Integer(),
167 Identity(always=False, on_null=True, start=42, cycle=True),
168 ),
169 )
170 text = " ON NULL" if testing.against("oracle") else ""
171 self.assert_compile(
172 CreateTable(t),
173 (
174 "CREATE TABLE foo_table (foo INTEGER GENERATED BY DEFAULT"
175 + text
176 + " AS IDENTITY (START WITH 42 CYCLE))"
177 ),
178 )
179
180
181class DefaultDialectIdentityDDL(_IdentityDDLFixture, fixtures.TestBase):

Callers

nothing calls this directly

Calls 8

TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
IntegerClass · 0.90
IdentityClass · 0.90
CreateTableClass · 0.85
assert_compileMethod · 0.80
againstMethod · 0.45

Tested by

no test coverage detected