MCPcopy Create free account
hub / github.com/zzzeek/sqlalchemy / test_append_column_replace_existing

Method test_append_column_replace_existing

test/sql/test_metadata.py:2147–2159  ·  view source on GitHub ↗
(self, field: Variation)

Source from the content-addressed store, hash-verified

2145
2146 @testing.variation("field", ["name", "key"])
2147 def test_append_column_replace_existing(self, field: Variation):
2148 if field.name:
2149 t = Table("t", MetaData(), Column("col", Integer))
2150 t.append_column(Column("col", String), replace_existing=True)
2151 is_true(isinstance(t.c.col.type, String))
2152 elif field.key:
2153 t = Table("t", MetaData(), Column("col", Integer, key="c2"))
2154 t.append_column(
2155 Column("col", String, key="c2"), replace_existing=True
2156 )
2157 is_true(isinstance(t.c.c2.type, String))
2158 else:
2159 field.fail()
2160
2161 def test_autoincrement_replace(self):
2162 m = MetaData()

Callers

nothing calls this directly

Calls 6

append_columnMethod · 0.95
TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90
is_trueFunction · 0.90
failMethod · 0.45

Tested by

no test coverage detected