MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_union_all

Method test_union_all

test/sql/test_query.py:1167–1182  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

1165 )
1166 @testing.fails_on("sqlite", "FIXME: unknown")
1167 def test_union_all(self, connection):
1168 t1, t2, t3 = self.tables("t1", "t2", "t3")
1169
1170 e = union_all(
1171 select(t1.c.col3),
1172 union(select(t1.c.col3), select(t1.c.col3)),
1173 )
1174
1175 wanted = [("aaa",), ("aaa",), ("bbb",), ("bbb",), ("ccc",), ("ccc",)]
1176 found1 = self._fetchall_sorted(connection.execute(e))
1177 eq_(found1, wanted)
1178
1179 found2 = self._fetchall_sorted(
1180 connection.execute(e.alias("foo").select())
1181 )
1182 eq_(found2, wanted)
1183
1184 def test_union_all_lightweight(self, connection):
1185 """like test_union_all, but breaks the sub-union into

Callers

nothing calls this directly

Calls 8

_fetchall_sortedMethod · 0.95
union_allFunction · 0.90
selectFunction · 0.90
unionFunction · 0.90
eq_Function · 0.90
executeMethod · 0.45
selectMethod · 0.45
aliasMethod · 0.45

Tested by

no test coverage detected