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

Method test_composite_alias

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

Source from the content-addressed store, hash-verified

1443
1444 @testing.requires.intersect
1445 def test_composite_alias(self, connection):
1446 t1, t2, t3 = self.tables("t1", "t2", "t3")
1447
1448 ua = intersect(
1449 select(t2.c.col3, t2.c.col4),
1450 union(
1451 select(t1.c.col3, t1.c.col4),
1452 select(t2.c.col3, t2.c.col4),
1453 select(t3.c.col3, t3.c.col4),
1454 )
1455 .alias()
1456 .select(),
1457 ).alias()
1458
1459 wanted = [("aaa", "bbb"), ("bbb", "ccc"), ("ccc", "aaa")]
1460 found = self._fetchall_sorted(connection.execute(ua.select()))
1461 eq_(found, wanted)
1462
1463
1464class 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