summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing
diff options
context:
space:
mode:
authorJan <BY-jk@users.noreply.github.com>2017-10-17 21:23:19 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-10-17 21:23:19 -0400
commit1de16235906e67fe112bcb31965b8f426ebccc6a (patch)
treeafe25fc5bf5a718107d3825a79f1ac80774724ee /lib/sqlalchemy/testing
parent1fbed902ede72e5a663b7e685843f0a8ed250c45 (diff)
downloadsqlalchemy-1de16235906e67fe112bcb31965b8f426ebccc6a.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/testing')
-rw-r--r--lib/sqlalchemy/testing/suite/test_select.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py
index 22ae1d8c5..77535e1a3 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,