]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
more py3k fixes
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Feb 2010 23:02:08 +0000 (23:02 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Feb 2010 23:02:08 +0000 (23:02 +0000)
test/aaa_profiling/test_compiler.py
test/aaa_profiling/test_orm.py
test/orm/test_unitofwork.py

index 4bb7b5bdeb5ff5306e6ce299b085849239ae1cac..b5645a2415cbf720846fff066b8454826b1419aa 100644 (file)
@@ -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()
 
index 6612783cca75e3a45e70f6ec10e53e561f7f61e3..8144415ef5c8b69fa3d438037f599568c3c8a350 100644 (file)
@@ -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)
             
index 65c363646df30f02762ef5cb2a7704d93e133bdb..b961e2d25a89c514bb1b6d1a674c4ab82df10179 100644 (file)
@@ -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()