MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_append_column_existing_name

Method test_append_column_existing_name

test/sql/test_metadata.py:2122–2132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2120 eq_([c.key for c in t.c], expected_cols)
2121
2122 def test_append_column_existing_name(self):
2123 t = Table("t", MetaData(), Column("col", Integer))
2124
2125 with testing.expect_raises_message(
2126 exc.DuplicateColumnError,
2127 r"A column with name 'col' is already present in table 't'. "
2128 r"Specify replace_existing=True to Table.append_column\(\) or "
2129 r"Table.insert_column\(\) to "
2130 r"replace an existing column.",
2131 ):
2132 t.append_column(Column("col", String))
2133
2134 def test_append_column_existing_key(self):
2135 t = Table("t", MetaData(), Column("col", Integer, key="c2"))

Callers

nothing calls this directly

Calls 4

append_columnMethod · 0.95
TableClass · 0.90
MetaDataClass · 0.90
ColumnClass · 0.90

Tested by

no test coverage detected