From: Mike Bayer Date: Thu, 18 Mar 2010 19:47:33 +0000 (+0000) Subject: - oracle needs a filter for this test X-Git-Tag: rel_0_6beta2~29^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6238032c8de254eb4702bfea13a30dea82f7b3ca;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - oracle needs a filter for this test - oracle outparam test reveals usage of numeric proc with scale==None --- diff --git a/lib/sqlalchemy/types.py b/lib/sqlalchemy/types.py index 3feac8f4fc..16cd57f268 100644 --- a/lib/sqlalchemy/types.py +++ b/lib/sqlalchemy/types.py @@ -940,7 +940,10 @@ class Numeric(_DateAffinity, TypeEngine): return None else: # we're a "numeric", DBAPI returns floats, convert. - return processors.to_decimal_processor_factory(_python_Decimal, self.scale) + if self.scale is not None: + return processors.to_decimal_processor_factory(_python_Decimal, self.scale) + else: + return processors.to_decimal_processor_factory(_python_Decimal) else: if dialect.supports_native_decimal: return processors.to_float diff --git a/test/sql/test_types.py b/test/sql/test_types.py index 123eab48ca..799e17f435 100644 --- a/test/sql/test_types.py +++ b/test/sql/test_types.py @@ -1113,10 +1113,16 @@ class NumericTest(TestBase): ) def test_numeric_as_float(self): + if testing.against("oracle+cx_oracle"): + filter_ = lambda n:round(n, 5) + else: + filter_ = None + self._do_test( Numeric(precision=8, scale=4, asdecimal=False), [15.7563, Decimal("15.7563")], - [15.7563] + [15.7563], + filter_ = filter_ ) def test_float_as_decimal(self):