| 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() |