From: Mike Bayer Date: Mon, 15 Feb 2010 22:37:37 +0000 (+0000) Subject: some more 2.4 test fixes X-Git-Tag: rel_0_6beta2~179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=739b7b0c2551255a1d0e062112fe2dc7d792cc62;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git some more 2.4 test fixes --- diff --git a/lib/sqlalchemy/test/requires.py b/lib/sqlalchemy/test/requires.py index 4f6c81a204..1ae6f7d7d4 100644 --- a/lib/sqlalchemy/test/requires.py +++ b/lib/sqlalchemy/test/requires.py @@ -185,3 +185,4 @@ def unicode_ddl(fn): no_support('sybase', 'FIXME: guessing, needs confirmation'), exclude('mysql', '<', (4, 1, 1), 'no unicode connection support'), ) + diff --git a/test/aaa_profiling/test_orm.py b/test/aaa_profiling/test_orm.py index 2979069cdc..6612783cca 100644 --- a/test/aaa_profiling/test_orm.py +++ b/test/aaa_profiling/test_orm.py @@ -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) diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index fbbc394c9d..b950836a98 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -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): diff --git a/test/ext/test_sqlsoup.py b/test/ext/test_sqlsoup.py index 0593a8ac42..718c27a2ad 100644 --- a/test/ext/test_sqlsoup.py +++ b/test/ext/test_sqlsoup.py @@ -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