MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_except_style1

Method test_except_style1

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

Source from the content-addressed store, hash-verified

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):

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