MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_int_limit_offset_coercion

Method test_int_limit_offset_coercion

test/sql/test_compiler.py:306–318  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

304 )
305
306 def test_int_limit_offset_coercion(self):
307 for given, exp in [
308 ("5", 5),
309 (5, 5),
310 (5.2, 5),
311 (decimal.Decimal("5"), 5),
312 (None, None),
313 ]:
314 eq_(select().limit(given)._limit, exp)
315 eq_(select().offset(given)._offset, exp)
316
317 assert_raises(ValueError, select().limit, "foo")
318 assert_raises(ValueError, select().offset, "foo")
319
320 def test_limit_offset_no_int_coercion_one(self):
321 exp1 = literal_column("Q")

Callers

nothing calls this directly

Calls 5

eq_Function · 0.90
selectFunction · 0.90
assert_raisesFunction · 0.90
limitMethod · 0.45
offsetMethod · 0.45

Tested by

no test coverage detected