]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- use a different approach here since oracle isn't doing it either, just round it
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Oct 2013 03:26:08 +0000 (23:26 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 22 Oct 2013 03:26:08 +0000 (23:26 -0400)
lib/sqlalchemy/testing/suite/test_types.py

index d04829a79b432a86db6d4ca9e52d5f359e548092..3eb105ba3ccfe7e63f5fa6e1d868354d5b68b65e 100644 (file)
@@ -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):