diff options
| author | Paul Johnston <paj@pajhome.org.uk> | 2007-11-25 23:34:39 +0000 |
|---|---|---|
| committer | Paul Johnston <paj@pajhome.org.uk> | 2007-11-25 23:34:39 +0000 |
| commit | 2c873f0ee45db04cb880de7c24b56564eb9605a4 (patch) | |
| tree | f1fae8cf4c2cd36834685b4794b72e469303704f /test/sql | |
| parent | 37bffd8f2b6c3b4419d6e9317bc097d52124360d (diff) | |
| download | sqlalchemy-2c873f0ee45db04cb880de7c24b56564eb9605a4.tar.gz | |
Fix: test_decimal on MSSQL - use a value that is accurately represented as a float, and make when asdecimal=False, convert Decimal to float
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/testtypes.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/sql/testtypes.py b/test/sql/testtypes.py index 7a9add947..8c247897f 100644 --- a/test/sql/testtypes.py +++ b/test/sql/testtypes.py @@ -587,8 +587,8 @@ class NumericTest(AssertMixin): def test_decimal(self): from decimal import Decimal - numeric_table.insert().execute(numericcol=3.5, floatcol=5.6, ncasdec=12.4, fcasdec=15.78) - numeric_table.insert().execute(numericcol=Decimal("3.5"), floatcol=Decimal("5.6"), ncasdec=Decimal("12.4"), fcasdec=Decimal("15.78")) + numeric_table.insert().execute(numericcol=3.5, floatcol=5.6, ncasdec=12.4, fcasdec=15.75) + numeric_table.insert().execute(numericcol=Decimal("3.5"), floatcol=Decimal("5.6"), ncasdec=Decimal("12.4"), fcasdec=Decimal("15.75")) l = numeric_table.select().execute().fetchall() print l rounded = [ @@ -596,8 +596,8 @@ class NumericTest(AssertMixin): (l[1][0], l[1][1], round(l[1][2], 5), l[1][3], l[1][4]), ] assert rounded == [ - (1, 3.5, 5.6, Decimal("12.4"), Decimal("15.78")), - (2, 3.5, 5.6, Decimal("12.4"), Decimal("15.78")), + (1, 3.5, 5.6, Decimal("12.4"), Decimal("15.75")), + (2, 3.5, 5.6, Decimal("12.4"), Decimal("15.75")), ] |
