| 1407 | |
| 1408 | @testing.requires.intersect |
| 1409 | def test_intersect_unions_2(self, connection): |
| 1410 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1411 | |
| 1412 | u = intersect( |
| 1413 | union(select(t1.c.col3, t1.c.col4), select(t3.c.col3, t3.c.col4)) |
| 1414 | .alias() |
| 1415 | .select(), |
| 1416 | union(select(t2.c.col3, t2.c.col4), select(t3.c.col3, t3.c.col4)) |
| 1417 | .alias() |
| 1418 | .select(), |
| 1419 | ) |
| 1420 | wanted = [("aaa", "ccc"), ("bbb", "aaa"), ("ccc", "bbb")] |
| 1421 | found = self._fetchall_sorted(connection.execute(u)) |
| 1422 | |
| 1423 | eq_(found, wanted) |
| 1424 | |
| 1425 | @testing.requires.intersect |
| 1426 | def test_intersect_unions_3(self, connection): |