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

Method test_select_limit_offset

test/sql/test_query.py:1011–1023  ·  view source on GitHub ↗

Test the interaction between limit and offset

(self, connection)

Source from the content-addressed store, hash-verified

1009
1010 @testing.requires.offset
1011 def test_select_limit_offset(self, connection):
1012 """Test the interaction between limit and offset"""
1013
1014 users, addresses = self.tables("users", "addresses")
1015
1016 r = connection.execute(
1017 users.select().limit(3).offset(2).order_by(users.c.user_id)
1018 ).fetchall()
1019 self.assert_(r == [(3, "ed"), (4, "wendy"), (5, "laura")])
1020 r = connection.execute(
1021 users.select().offset(5).order_by(users.c.user_id)
1022 ).fetchall()
1023 self.assert_(r == [(6, "ralph"), (7, "fido")])
1024
1025 def test_select_distinct_limit(self, connection):
1026 """Test the interaction between limit and distinct"""

Callers

nothing calls this directly

Calls 7

fetchallMethod · 0.45
executeMethod · 0.45
order_byMethod · 0.45
offsetMethod · 0.45
limitMethod · 0.45
selectMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected