From: Mike Bayer Date: Mon, 7 Oct 2019 20:18:41 +0000 (-0400) Subject: Remove order_by in textual test X-Git-Tag: rel_1_4_0b1~694 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4dcf3dda63bfd9254ac5864cc3d7003093c9a54;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Remove order_by in textual test Fixes for SQL server Change-Id: I089bb9d400fb1b0708340792c3840e44bffa37e4 --- diff --git a/lib/sqlalchemy/engine/result.py b/lib/sqlalchemy/engine/result.py index af5303658b..eccea6daae 100644 --- a/lib/sqlalchemy/engine/result.py +++ b/lib/sqlalchemy/engine/result.py @@ -711,7 +711,7 @@ class ResultMetaData(object): break else: result = None - if result is not None: + if False: # result is not None: if result[MD_OBJECTS] is _UNPICKLED: util.warn_deprecated( "Retreiving row values using Column objects from a " diff --git a/test/orm/test_query.py b/test/orm/test_query.py index 7c4811dc79..d5dddb3aa3 100644 --- a/test/orm/test_query.py +++ b/test/orm/test_query.py @@ -4284,12 +4284,15 @@ class TextTest(QueryTest, AssertsCompiledSQL): s = create_session() q = ( s.query(User) - .from_statement(text("select * from users ORDER BY users.id")) + .from_statement(text("select * from users")) .options(subqueryload(User.addresses)) ) + # we can't ORDER BY in this test because SQL server won't let the + # ORDER BY work inside the subqueryload; the test needs to use + # subqueryload (not selectinload) to confirm the feature def go(): - eq_(q.all(), self.static.user_address_result) + eq_(set(q.all()), set(self.static.user_address_result)) self.assert_sql_count(testing.db, go, 2)