From: Mike Bayer Date: Sat, 20 Feb 2010 23:02:08 +0000 (+0000) Subject: more py3k fixes X-Git-Tag: rel_0_6beta2~168 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20d6baa09f461b49e8c00d3b8b437284438d4dd5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git more py3k fixes --- diff --git a/test/aaa_profiling/test_compiler.py b/test/aaa_profiling/test_compiler.py index 4bb7b5bdeb..b5645a2415 100644 --- a/test/aaa_profiling/test_compiler.py +++ b/test/aaa_profiling/test_compiler.py @@ -23,7 +23,7 @@ class CompileTest(TestBase, AssertsExecutionResults): def test_update(self): t1.update().compile() - @profiling.function_call_count(122, {'2.4': 81}) + @profiling.function_call_count(122, {'2.4': 81, '3':132}) def test_update_whereclause(self): t1.update().where(t1.c.c2==12).compile() diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index 6612783cca..8144415ef5 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -58,7 +58,7 @@ class MergeTest(_base.MappedTest): # down from 185 on this # this is a small slice of a usually bigger # operation so using a small variance - @profiling.function_call_count(95, variance=0.001, versions={'2.4':67}) + @profiling.function_call_count(95, variance=0.001, versions={'2.4':67, '3':96}) def go(): return sess2.merge(p1, load=False) @@ -66,7 +66,7 @@ class MergeTest(_base.MappedTest): # third call, merge object already present. # almost no calls. - @profiling.function_call_count(12, variance=0.001, versions={'2.4':8}) + @profiling.function_call_count(12, variance=0.001, versions={'2.4':8, '3':13}) def go(): return sess2.merge(p2, load=False) diff --git a/test/orm/test_unitofwork.py b/test/orm/test_unitofwork.py index 65c363646d..b961e2d25a 100644 --- a/test/orm/test_unitofwork.py +++ b/test/orm/test_unitofwork.py @@ -360,20 +360,26 @@ class BinaryHistTest(_base.MappedTest, testing.AssertsExecutionResults): @testing.resolve_artifact_names def test_binary_equality(self): + # Py3K + #data = b"this is some data" + # Py2K + data = "this is some data" + # end Py2K + mapper(Foo, t1) s = create_session() - f1 = Foo(data="this is some data") + f1 = Foo(data=data) s.add(f1) s.flush() s.expire_all() f1 = s.query(Foo).first() - assert f1.data == "this is some data" - f1.data = "this is some data" + assert f1.data == data + f1.data = data eq_( sa.orm.attributes.get_history(f1, "data"), - ((), ["this is some data"], ()) + ((), [data], ()) ) def go(): s.flush()