]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
some more 2.4 test fixes
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 15 Feb 2010 22:37:37 +0000 (22:37 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 15 Feb 2010 22:37:37 +0000 (22:37 +0000)
lib/sqlalchemy/test/requires.py
test/aaa_profiling/test_orm.py
test/dialect/test_postgresql.py
test/ext/test_sqlsoup.py

index 4f6c81a204564a8dc71c714599d2ab241d6af3b5..1ae6f7d7d4b1d3dc51edf006e30063f829bf63f6 100644 (file)
@@ -185,3 +185,4 @@ def unicode_ddl(fn):
         no_support('sybase', 'FIXME: guessing, needs confirmation'),
         exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'),
         )
+
index 2979069cdced5e559648c9397f78739d0cf6dc9c..6612783cca75e3a45e70f6ec10e53e561f7f61e3 100644 (file)
@@ -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)
+        @profiling.function_call_count(12, variance=0.001, versions={'2.4':8})
         def go():
             return sess2.merge(p2, load=False)
             
index fbbc394c9dda775818c2e57f6c736fe760c8c2e7..b950836a98e7a3a63e83c62ad961dda527a55aad 100644 (file)
@@ -208,7 +208,8 @@ class FloatCoercionTest(TablesTest, AssertsExecutionResults):
             return round(x, 9)
         elif isinstance(x, decimal.Decimal):
             # really ?
-            x = x.shift(decimal.Decimal(9)).to_integral() / pow(10, 9)
+            # (can also use shift() here but that is 2.6 only)
+            x = (x * decimal.Decimal("1000000000")).to_integral() / pow(10, 9)
         return x
     @testing.resolve_artifact_names
     def test_float_coercion(self):
index 0593a8ac42ffebaa88c2dbaa695ce83ff538f394..718c27a2ada700b07833052179b0455e32844f2d 100644 (file)
@@ -7,9 +7,21 @@ from sqlalchemy import create_engine, or_, desc, select, func, exc, Table,\
 from sqlalchemy.orm import scoped_session, sessionmaker
 import datetime
 
+
 class SQLSoupTest(TestBase):
-    __skip_if__ = (lambda: util.jython,)
-    
+    __skip_if__ = (lambda: not SQLSoupTest._has_sqlite(),)
+
+    @classmethod
+    def _has_sqlite(cls):
+        try:
+            import sqlite3
+        except ImportError:
+            try:
+                import pysqlite2
+            except ImportError:
+                return False
+        return True
+        
     @classmethod
     def setup_class(cls):
         global engine