summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-10-21 23:26:08 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-10-21 23:26:08 -0400
commit15f781cc3defb02ff799c409492156e10b675534 (patch)
tree6741b103b7de59a0362baf4b47ca5f6481424f82
parent5d5700c40e0abc6c228c03c6261bdc6627a3e02a (diff)
downloadsqlalchemy-15f781cc3defb02ff799c409492156e10b675534.tar.gz
- use a different approach here since oracle isn't doing it either, just round it
-rw-r--r--lib/sqlalchemy/testing/suite/test_types.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py
index d04829a79..3eb105ba3 100644
--- a/lib/sqlalchemy/testing/suite/test_types.py
+++ b/lib/sqlalchemy/testing/suite/test_types.py
@@ -16,7 +16,7 @@ from ... import util
class _LiteralRoundTripFixture(object):
@testing.provide_metadata
- def _literal_round_trip(self, type_, input_, output):
+ def _literal_round_trip(self, type_, input_, output, filter_=None):
"""test literal rendering """
# for literal, we test the literal render in an INSERT
@@ -34,7 +34,10 @@ class _LiteralRoundTripFixture(object):
testing.db.execute(ins)
for row in t.select().execute():
- assert row[0] in output
+ value = row[0]
+ if filter_ is not None:
+ value = filter_(value)
+ assert value in output
class _UnicodeFixture(_LiteralRoundTripFixture):
@@ -345,12 +348,12 @@ class NumericTest(_LiteralRoundTripFixture, fixtures.TestBase):
[15.7563],
)
- @testing.requires.floats_to_four_decimals
def test_render_literal_float(self):
self._literal_round_trip(
Float(4),
[15.7563, decimal.Decimal("15.7563")],
[15.7563,],
+ filter_=lambda n: n is not None and round(n, 5) or None
)
def test_numeric_as_decimal(self):