diff options
| author | Michael Trier <mtrier@gmail.com> | 2008-11-10 01:11:43 +0000 |
|---|---|---|
| committer | Michael Trier <mtrier@gmail.com> | 2008-11-10 01:11:43 +0000 |
| commit | d360fd7fe33bdc7f3c0fc9c41a52c17f440b9310 (patch) | |
| tree | 6b7c0f20e7013cd71417b5397be26f13e4e6e8b0 | |
| parent | a8cd5cfd390456fef02b5edc655dba5c30adcb1b (diff) | |
| download | sqlalchemy-d360fd7fe33bdc7f3c0fc9c41a52c17f440b9310.tar.gz | |
Corrected issue with decimal e notation that broke regular decimal tests for mssql.
| -rw-r--r-- | lib/sqlalchemy/databases/mssql.py | 2 | ||||
| -rw-r--r-- | test/sql/testtypes.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index 923e85cea..b254941ab 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -69,7 +69,7 @@ class MSNumeric(sqltypes.Numeric): # Not sure that this exception is needed return value else: - if value._exp < 6: + if not isinstance(value, float) and value._exp < -6: value = ((value < 0 and '-' or '') + '0.' + '0' * -(value._exp+1) diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index 457deb44e..d1e12d2cd 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -708,10 +708,10 @@ class NumericTest(TestBase, AssertsExecutionResults): (l[0][0], l[0][1], round(l[0][2], 5), l[0][3], l[0][4]), (l[1][0], l[1][1], round(l[1][2], 5), l[1][3], l[1][4]), ] - assert rounded == [ + testing.eq_(rounded, [ (1, 3.5, 5.6, Decimal("12.4"), Decimal("15.75")), (2, 3.5, 5.6, Decimal("12.4"), Decimal("15.75")), - ] + ]) def test_decimal_fallback(self): from decimal import Decimal |
