From: Jan Date: Wed, 18 Oct 2017 01:23:19 +0000 (-0400) Subject: add order_by clause to make tests stable X-Git-Tag: rel_1_2_0~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1de16235906e67fe112bcb31965b8f426ebccc6a;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git add order_by clause to make tests stable I observed test runs that failed on 'test_bound_in_scalar' due to arbitrary ordering of the result set. The assertion not only tests for the elements to be present, but also for the correct ordering. Hence, the proposal to add an order_by clause to the select statements. Change-Id: If1fbb864761e77dfd2a42ef857801c8aaf893bee Pull-request: https://github.com/zzzeek/sqlalchemy/pull/389 --- diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py index 22ae1d8c57..77535e1a32 100644 --- a/lib/sqlalchemy/testing/suite/test_select.py +++ b/lib/sqlalchemy/testing/suite/test_select.py @@ -345,7 +345,7 @@ class ExpandingBoundInTest(fixtures.TablesTest): table = self.tables.some_table stmt = select([table.c.id]).where( - table.c.x.in_(bindparam('q', expanding=True))) + table.c.x.in_(bindparam('q', expanding=True))).order_by(table.c.id) self._assert_result( stmt, @@ -358,7 +358,7 @@ class ExpandingBoundInTest(fixtures.TablesTest): table = self.tables.some_table stmt = select([table.c.id]).where( - tuple_(table.c.x, table.c.y).in_(bindparam('q', expanding=True))) + tuple_(table.c.x, table.c.y).in_(bindparam('q', expanding=True))).order_by(table.c.id) self._assert_result( stmt,