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

Method test_except_style1

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

Source from the content-addressed store, hash-verified

1293 @testing.requires.except_
1294 @testing.fails_on("sqlite", "Can't handle this style of nesting")
1295 def test_except_style1(self, connection):
1296 t1, t2, t3 = self.tables("t1", "t2", "t3")
1297
1298 e = except_(
1299 union(
1300 select(t1.c.col3, t1.c.col4),
1301 select(t2.c.col3, t2.c.col4),
1302 select(t3.c.col3, t3.c.col4),
1303 ),
1304 select(t2.c.col3, t2.c.col4),
1305 )
1306
1307 wanted = [
1308 ("aaa", "aaa"),
1309 ("aaa", "ccc"),
1310 ("bbb", "aaa"),
1311 ("bbb", "bbb"),
1312 ("ccc", "bbb"),
1313 ("ccc", "ccc"),
1314 ]
1315
1316 found = self._fetchall_sorted(connection.execute(e.alias().select()))
1317 eq_(found, wanted)
1318
1319 @testing.requires.except_
1320 def test_except_style2(self, connection):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected