summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2020-05-10 14:37:21 +0200
committerFederico Caselli <cfederico87@gmail.com>2020-05-11 21:47:08 +0200
commit447f16bc7fd5afa1e0b1ca8a558354915ead239f (patch)
tree61f5ea25ca8fcb9e288336b0348fe3404480c0d6
parent5311a8531c621760ced0b3d0a5454e8c22871d66 (diff)
downloadsqlalchemy-447f16bc7fd5afa1e0b1ca8a558354915ead239f.tar.gz
Ensure order in doctest of core/tutorial.rst
Fix doctest error caused by the missing order by clause in the tests introduced in Ia1bbe3248b4f7c74fbee06fedf76a6ce94cd28a6 Change-Id: I55b45690879ebbaa57bc62765fcdab06f5e9c6f3
-rw-r--r--doc/build/core/tutorial.rst8
-rw-r--r--test/base/test_tutorials.py3
2 files changed, 7 insertions, 4 deletions
diff --git a/doc/build/core/tutorial.rst b/doc/build/core/tutorial.rst
index fe1551cc8..1f475abe3 100644
--- a/doc/build/core/tutorial.rst
+++ b/doc/build/core/tutorial.rst
@@ -1341,7 +1341,7 @@ typically acquires using the :meth:`_expression.Select.cte` method on a
.. sourcecode:: pycon+sql
>>> users_cte = select([users.c.id, users.c.name]).where(users.c.name == 'wendy').cte()
- >>> stmt = select([addresses]).where(addresses.c.user_id == users_cte.c.id)
+ >>> stmt = select([addresses]).where(addresses.c.user_id == users_cte.c.id).order_by(addresses.c.id)
>>> conn.execute(stmt).fetchall()
{opensql}WITH anon_1 AS
(SELECT users.id AS id, users.name AS name
@@ -1349,7 +1349,7 @@ typically acquires using the :meth:`_expression.Select.cte` method on a
WHERE users.name = ?)
SELECT addresses.id, addresses.user_id, addresses.email_address
FROM addresses, anon_1
- WHERE addresses.user_id = anon_1.id
+ WHERE addresses.user_id = anon_1.id ORDER BY addresses.id
('wendy',)
{stop}[(3, 2, 'www@www.org'), (4, 2, 'wendy@aol.com')]
@@ -1378,7 +1378,7 @@ this form looks like:
>>> users_cte = select([users.c.id, users.c.name]).cte(recursive=True)
>>> users_recursive = users_cte.alias()
>>> users_cte = users_cte.union(select([users.c.id, users.c.name]).where(users.c.id > users_recursive.c.id))
- >>> stmt = select([addresses]).where(addresses.c.user_id == users_cte.c.id)
+ >>> stmt = select([addresses]).where(addresses.c.user_id == users_cte.c.id).order_by(addresses.c.id)
>>> conn.execute(stmt).fetchall()
{opensql}WITH RECURSIVE anon_1(id, name) AS
(SELECT users.id AS id, users.name AS name
@@ -1387,7 +1387,7 @@ this form looks like:
WHERE users.id > anon_2.id)
SELECT addresses.id, addresses.user_id, addresses.email_address
FROM addresses, anon_1
- WHERE addresses.user_id = anon_1.id
+ WHERE addresses.user_id = anon_1.id ORDER BY addresses.id
()
{stop}[(1, 1, 'jack@yahoo.com'), (2, 1, 'jack@msn.com'), (3, 2, 'www@www.org'), (4, 2, 'wendy@aol.com')]
diff --git a/test/base/test_tutorials.py b/test/base/test_tutorials.py
index 4b8de298b..3ac7913f9 100644
--- a/test/base/test_tutorials.py
+++ b/test/base/test_tutorials.py
@@ -152,3 +152,6 @@ def _get_allow_unicode_flag():
import doctest
return doctest.register_optionflag("ALLOW_UNICODE")
+
+
+# increase number to force pipeline run. 1