MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / test_select_distinct_offset

Method test_select_distinct_offset

test/sql/test_query.py:974–991  ·  view source on GitHub ↗

Test the interaction between distinct and offset

(self, connection)

Source from the content-addressed store, hash-verified

972
973 @testing.requires.offset
974 def test_select_distinct_offset(self, connection):
975 """Test the interaction between distinct and offset"""
976
977 users, addresses = self.tables("users", "addresses")
978
979 r = sorted(
980 [
981 x[0]
982 for x in connection.execute(
983 select(addresses.c.address)
984 .distinct()
985 .offset(1)
986 .order_by(addresses.c.address)
987 ).fetchall()
988 ]
989 )
990 eq_(len(r), 4)
991 self.assert_(r[0] != r[1] and r[1] != r[2] and r[2] != [3], repr(r))
992
993 @testing.requires.offset
994 def test_select_distinct_limit_offset(self, connection):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected