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

Method test_select_distinct_offset

test/sql/test_query.py:1042–1059  ·  view source on GitHub ↗

Test the interaction between distinct and offset

(self, connection)

Source from the content-addressed store, hash-verified

1040
1041 @testing.requires.offset
1042 def test_select_distinct_offset(self, connection):
1043 """Test the interaction between distinct and offset"""
1044
1045 users, addresses = self.tables("users", "addresses")
1046
1047 r = sorted(
1048 [
1049 x[0]
1050 for x in connection.execute(
1051 select(addresses.c.address)
1052 .distinct()
1053 .offset(1)
1054 .order_by(addresses.c.address)
1055 ).fetchall()
1056 ]
1057 )
1058 eq_(len(r), 4)
1059 self.assert_(r[0] != r[1] and r[1] != r[2] and r[2] != [3], repr(r))
1060
1061 @testing.requires.offset
1062 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