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

Method test_col_subclass_copy

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

Source from the content-addressed store, hash-verified

137 eq_(a2._colspec, "bat.blah")
138
139 def test_col_subclass_copy(self):
140 class MyColumn(schema.Column):
141 def __init__(self, *args, **kw):
142 self.widget = kw.pop("widget", None)
143 super().__init__(*args, **kw)
144
145 def _copy(self, *arg, **kw):
146 c = super()._copy(*arg, **kw)
147 c.widget = self.widget
148 return c
149
150 c1 = MyColumn("foo", Integer, widget="x")
151 c2 = c1._copy()
152 assert isinstance(c2, MyColumn)
153 eq_(c2.widget, "x")
154
155 def test_uninitialized_column_copy_events(self):
156 msgs = []

Callers

nothing calls this directly

Calls 3

_copyMethod · 0.95
eq_Function · 0.90
MyColumnClass · 0.70

Tested by

no test coverage detected