

def test_group_by_composed(self):
    table = self.tables.some_table
    expr = (table.c.x + table.c.y).label('lx')
    stmt = select([func.count(table.c.id), expr]).group_by(expr).order_by(expr)
    self._assert_result(stmt, [(1, 3), (1, 5), (1, 7)])

dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/testing/suite/test_select.py OrderByLabelTest.test_group_by_composed/original