MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_composite_alias

Method test_composite_alias

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

Source from the content-addressed store, hash-verified

1375
1376 @testing.requires.intersect
1377 def test_composite_alias(self, connection):
1378 t1, t2, t3 = self.tables("t1", "t2", "t3")
1379
1380 ua = intersect(
1381 select(t2.c.col3, t2.c.col4),
1382 union(
1383 select(t1.c.col3, t1.c.col4),
1384 select(t2.c.col3, t2.c.col4),
1385 select(t3.c.col3, t3.c.col4),
1386 )
1387 .alias()
1388 .select(),
1389 ).alias()
1390
1391 wanted = [("aaa", "bbb"), ("bbb", "ccc"), ("ccc", "aaa")]
1392 found = self._fetchall_sorted(connection.execute(ua.select()))
1393 eq_(found, wanted)
1394
1395
1396class JoinTest(fixtures.TablesTest):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected