From d363a4b0bbc5de22ec77bb1b2f0fd64e30e4009e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 8 Oct 2013 10:42:13 -0400 Subject: [PATCH] - fix a bunch of test failures --- lib/sqlalchemy/orm/strategy_options.py | 2 +- test/orm/test_deferred.py | 11 ++++++----- test/orm/test_options.py | 2 +- test/profiles.txt | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/sqlalchemy/orm/strategy_options.py b/lib/sqlalchemy/orm/strategy_options.py index 0e2cf3a61c..72dafb472f 100644 --- a/lib/sqlalchemy/orm/strategy_options.py +++ b/lib/sqlalchemy/orm/strategy_options.py @@ -171,7 +171,7 @@ class Load(Generative, MapperOption): def _coerce_strat(self, strategy): if strategy is not None: - strategy = tuple(strategy.items()) + strategy = tuple(sorted(strategy.items())) return strategy @_generative diff --git a/test/orm/test_deferred.py b/test/orm/test_deferred.py index 3336f03b53..88e7e86633 100644 --- a/test/orm/test_deferred.py +++ b/test/orm/test_deferred.py @@ -5,7 +5,7 @@ from sqlalchemy.orm import mapper, deferred, defer, undefer, Load, \ joinedload, defaultload from sqlalchemy.testing import eq_, AssertsCompiledSQL from test.orm import _fixtures - +from sqlalchemy.orm import strategies class DeferredTest(AssertsCompiledSQL, _fixtures.FixtureTest): @@ -536,10 +536,11 @@ class DeferredOptionsTest(AssertsCompiledSQL, _fixtures.FixtureTest): addresses = self.tables.addresses orders = self.tables.orders - mapper(User, users, properties={ - "addresses": relationship(Address, lazy="joined"), - "orders": relationship(Order, lazy="joined") - }) + mapper(User, users, properties=util.OrderedDict([ + ("addresses", relationship(Address, lazy="joined")), + ("orders", relationship(Order, lazy="joined")) + ])) + mapper(Address, addresses) mapper(Order, orders) diff --git a/test/orm/test_options.py b/test/orm/test_options.py index 29c2c698e1..6eba38d15c 100644 --- a/test/orm/test_options.py +++ b/test/orm/test_options.py @@ -141,7 +141,7 @@ class LoadTest(PathTest, QueryTest): l1 = Load(User) l2 = l1.defer("name") - l3 = l2.context.values()[0] + l3 = list(l2.context.values())[0] eq_( l1.context, { diff --git a/test/profiles.txt b/test/profiles.txt index 9b6cf5aa52..c1ee8638a3 100644 --- a/test/profiles.txt +++ b/test/profiles.txt @@ -399,7 +399,7 @@ test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_6_editing 3.3_postgresq # TEST: test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview -test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_cextensions 2300 +test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_cextensions 2424 test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 2.7_postgresql_psycopg2_nocextensions 2559 test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 3.2_postgresql_psycopg2_nocextensions 2483 test.aaa_profiling.test_zoomark.ZooMarkTest.test_profile_7_multiview 3.3_postgresql_psycopg2_cextensions 2460 -- 2.47.3