MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_intersect_unions_3

Method test_intersect_unions_3

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

Source from the content-addressed store, hash-verified

1356
1357 @testing.requires.intersect
1358 def test_intersect_unions_3(self, connection):
1359 t1, t2, t3 = self.tables("t1", "t2", "t3")
1360
1361 u = intersect(
1362 select(t2.c.col3, t2.c.col4),
1363 union(
1364 select(t1.c.col3, t1.c.col4),
1365 select(t2.c.col3, t2.c.col4),
1366 select(t3.c.col3, t3.c.col4),
1367 )
1368 .alias()
1369 .select(),
1370 )
1371 wanted = [("aaa", "bbb"), ("bbb", "ccc"), ("ccc", "aaa")]
1372 found = self._fetchall_sorted(connection.execute(u))
1373
1374 eq_(found, wanted)
1375
1376 @testing.requires.intersect
1377 def test_composite_alias(self, connection):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected