MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_column_computed

Method test_column_computed

test/sql/test_computed.py:26–39  ·  view source on GitHub ↗
(self, text, persisted)

Source from the content-addressed store, hash-verified

24 id_="iaa",
25 )
26 def test_column_computed(self, text, persisted):
27 m = MetaData()
28 kwargs = {"persisted": persisted} if persisted != "ignore" else {}
29 t = Table(
30 "t",
31 m,
32 Column("x", Integer),
33 Column("y", Integer, Computed("x + 2", **kwargs)),
34 )
35 self.assert_compile(
36 CreateTable(t),
37 "CREATE TABLE t (x INTEGER, y INTEGER GENERATED "
38 "ALWAYS AS (x + 2)%s)" % text,
39 )
40
41 def test_other_options(self):
42 t = Table(

Callers

nothing calls this directly

Calls 6

MetaDataClass · 0.90
TableClass · 0.90
ColumnClass · 0.90
ComputedClass · 0.90
CreateTableClass · 0.85
assert_compileMethod · 0.80

Tested by

no test coverage detected