| 1225 | @testing.requires.except_ |
| 1226 | @testing.fails_on("sqlite", "Can't handle this style of nesting") |
| 1227 | def test_except_style1(self, connection): |
| 1228 | t1, t2, t3 = self.tables("t1", "t2", "t3") |
| 1229 | |
| 1230 | e = except_( |
| 1231 | union( |
| 1232 | select(t1.c.col3, t1.c.col4), |
| 1233 | select(t2.c.col3, t2.c.col4), |
| 1234 | select(t3.c.col3, t3.c.col4), |
| 1235 | ), |
| 1236 | select(t2.c.col3, t2.c.col4), |
| 1237 | ) |
| 1238 | |
| 1239 | wanted = [ |
| 1240 | ("aaa", "aaa"), |
| 1241 | ("aaa", "ccc"), |
| 1242 | ("bbb", "aaa"), |
| 1243 | ("bbb", "bbb"), |
| 1244 | ("ccc", "bbb"), |
| 1245 | ("ccc", "ccc"), |
| 1246 | ] |
| 1247 | |
| 1248 | found = self._fetchall_sorted(connection.execute(e.alias().select())) |
| 1249 | eq_(found, wanted) |
| 1250 | |
| 1251 | @testing.requires.except_ |
| 1252 | def test_except_style2(self, connection): |