From 1de16235906e67fe112bcb31965b8f426ebccc6a Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 17 Oct 2017 21:23:19 -0400 Subject: [PATCH] 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 --- lib/sqlalchemy/testing/suite/test_select.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, -- 2.47.3