MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_distinct_limit_offset

Method test_select_distinct_limit_offset

test/sql/test_query.py:994–1007  ·  view source on GitHub ↗

Test the interaction between limit and limit/offset

(self, connection)

Source from the content-addressed store, hash-verified

992
993 @testing.requires.offset
994 def test_select_distinct_limit_offset(self, connection):
995 """Test the interaction between limit and limit/offset"""
996
997 users, addresses = self.tables("users", "addresses")
998
999 r = connection.execute(
1000 select(addresses.c.address)
1001 .order_by(addresses.c.address)
1002 .distinct()
1003 .offset(2)
1004 .limit(3)
1005 ).fetchall()
1006 self.assert_(len(r) == 3, repr(r))
1007 self.assert_(r[0] != r[1] and r[1] != r[2], repr(r))
1008
1009
1010class CompoundTest(fixtures.TablesTest):

Callers

nothing calls this directly

Calls 8

selectFunction · 0.90
fetchallMethod · 0.45
executeMethod · 0.45
limitMethod · 0.45
offsetMethod · 0.45
distinctMethod · 0.45
order_byMethod · 0.45
assert_Method · 0.45

Tested by

no test coverage detected