From: Mike Bayer Date: Sat, 22 Mar 2014 22:48:59 +0000 (-0400) Subject: - Fixed a few errant ``u''`` strings that would prevent tests from passing X-Git-Tag: rel_0_9_4~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5d2bfc4df45bd2f3347391c67b975066fdb74723;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Fixed a few errant ``u''`` strings that would prevent tests from passing in Py3.2. Patch courtesy Arfrever Frehtes Taifersar Arahesis. fixes #2980 --- diff --git a/doc/build/changelog/changelog_09.rst b/doc/build/changelog/changelog_09.rst index c4fa76e493..be3e9af650 100644 --- a/doc/build/changelog/changelog_09.rst +++ b/doc/build/changelog/changelog_09.rst @@ -14,6 +14,13 @@ .. changelog:: :version: 0.9.4 + .. change:: + :tags: bug, tests + :tickets: 2980 + + Fixed a few errant ``u''`` strings that would prevent tests from passing + in Py3.2. Patch courtesy Arfrever Frehtes Taifersar Arahesis. + .. change:: :tags: bug, engine :tickets: 2985 diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py index f2b948c63d..4099b54d76 100644 --- a/test/dialect/test_sqlite.py +++ b/test/dialect/test_sqlite.py @@ -111,7 +111,7 @@ class TestTypes(fixtures.TestBase, AssertsExecutionResults): testing.db.execute("insert into t (d) values ('2004-05-21T00:00:00')") eq_( testing.db.execute("select * from t order by d").fetchall(), - [(u'2004-05-21T00:00:00',), (u'2010-10-15T12:37:00',)] + [('2004-05-21T00:00:00',), ('2010-10-15T12:37:00',)] ) eq_( testing.db.execute(select([t.c.d]).order_by(t.c.d)).fetchall(), @@ -133,7 +133,7 @@ class TestTypes(fixtures.TestBase, AssertsExecutionResults): testing.db.execute("insert into t (d) values ('2004|05|21')") eq_( testing.db.execute("select * from t order by d").fetchall(), - [(u'2004|05|21',), (u'2010|10|15',)] + [('2004|05|21',), ('2010|10|15',)] ) eq_( testing.db.execute(select([t.c.d]).order_by(t.c.d)).fetchall(), diff --git a/test/orm/test_default_strategies.py b/test/orm/test_default_strategies.py index a127f2ba5d..49311224de 100644 --- a/test/orm/test_default_strategies.py +++ b/test/orm/test_default_strategies.py @@ -161,14 +161,14 @@ class DefaultStrategyOptionsTest(_fixtures.FixtureTest): User = self.classes.User opt = sa.orm.lazyload('*') q = sess.query(User.name).options(opt) - eq_(q.all(), [(u'jack',), (u'ed',), (u'fred',), (u'chuck',)]) + eq_(q.all(), [('jack',), ('ed',), ('fred',), ('chuck',)]) def test_global_star_ignored_no_entities_bound(self): sess = self._downgrade_fixture() User = self.classes.User opt = sa.orm.Load(User).lazyload('*') q = sess.query(User.name).options(opt) - eq_(q.all(), [(u'jack',), (u'ed',), (u'fred',), (u'chuck',)]) + eq_(q.all(), [('jack',), ('ed',), ('fred',), ('chuck',)]) def test_select_with_joinedload(self): """Mapper load strategy defaults can be downgraded with diff --git a/test/orm/test_subquery_relations.py b/test/orm/test_subquery_relations.py index f36820e70c..4958bdfd5b 100644 --- a/test/orm/test_subquery_relations.py +++ b/test/orm/test_subquery_relations.py @@ -1701,16 +1701,16 @@ class SubqueryloadDistinctTest(fixtures.DeclarativeMappedTest, rows = result.fetchall() if expect_distinct: eq_(set(tuple(t) for t in rows), set([ - (1, u'/1.jpg', 1, 1), - (2, u'/2.jpg', 1, 1), + (1, '/1.jpg', 1, 1), + (2, '/2.jpg', 1, 1), ])) else: # oracle might not order the way we expect here eq_(set(tuple(t) for t in rows), set([ - (1, u'/1.jpg', 1, 1), - (2, u'/2.jpg', 1, 1), - (1, u'/1.jpg', 1, 1), - (2, u'/2.jpg', 1, 1), + (1, '/1.jpg', 1, 1), + (2, '/2.jpg', 1, 1), + (1, '/1.jpg', 1, 1), + (2, '/2.jpg', 1, 1), ])) diff --git a/test/sql/test_update.py b/test/sql/test_update.py index a1b64d8628..272b5fcaee 100644 --- a/test/sql/test_update.py +++ b/test/sql/test_update.py @@ -306,7 +306,7 @@ class UpdateFromCompileTest(_UpdateFromTestBase, fixtures.TablesTest, where(users.c.id == addresses.c.user_id), "UPDATE users, addresses SET addresses.name=%s, " "users.name=%s WHERE users.id = addresses.user_id", - checkparams={u'addresses_name': 'new address', 'name': 'newname'}, + checkparams={'addresses_name': 'new address', 'name': 'newname'}, dialect='mysql' )