MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / CoreFixtures

Class CoreFixtures

test/sql/test_compare.py:185–1303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183
184
185class CoreFixtures:
186 # lambdas which return a tuple of ColumnElement objects.
187 # must return at least two objects that should compare differently.
188 # to test more varieties of "difference" additional objects can be added.
189 fixtures = [
190 lambda: (
191 column("q"),
192 column("x"),
193 column("q", Integer),
194 column("q", String),
195 ),
196 lambda: (~column("q", Boolean), ~column("p", Boolean)),
197 lambda: (
198 table_a.c.a.label("foo"),
199 table_a.c.a.label("bar"),
200 table_a.c.b.label("foo"),
201 ),
202 lambda: (
203 _label_reference(table_a.c.a.desc()),
204 _label_reference(table_a.c.a.asc()),
205 ),
206 lambda: (
207 TypeClause(String(50)),
208 TypeClause(DateTime()),
209 ),
210 lambda: (
211 table_a.c.a,
212 ElementList([table_a.c.a]),
213 ElementList([table_a.c.a, table_a.c.b]),
214 ),
215 lambda: (
216 table_a.c.a,
217 OrderByList([table_a.c.a]),
218 OrderByList(
219 [table_a.c.a, OrderByList([table_a.c.b, table_b.c.a])]
220 ),
221 ),
222 lambda: (_textual_label_reference("a"), _textual_label_reference("b")),
223 lambda: (
224 text("select a, b from table").columns(a=Integer, b=String),
225 text("select a, b, c from table").columns(
226 a=Integer, b=String, c=Integer
227 ),
228 text("select a, b, c from table where foo=:bar").bindparams(
229 bindparam("bar", type_=Integer)
230 ),
231 text("select a, b, c from table where foo=:foo").bindparams(
232 bindparam("foo", type_=Integer)
233 ),
234 text("select a, b, c from table where foo=:bar").bindparams(
235 bindparam("bar", type_=String)
236 ),
237 ),
238 lambda: (
239 # test #11471
240 text("select * from table")
241 .columns(a=Integer())
242 .add_cte(table_b.select().cte()),

Callers

nothing calls this directly

Calls 15

columnFunction · 0.90
_label_referenceClass · 0.90
TypeClauseClass · 0.90
StringClass · 0.90
DateTimeClass · 0.90
ElementListClass · 0.90
OrderByListClass · 0.90
textFunction · 0.90
bindparamFunction · 0.90
IntegerClass · 0.90
unionFunction · 0.90

Tested by

no test coverage detected