From 15f781cc3defb02ff799c409492156e10b675534 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 21 Oct 2013 23:26:08 -0400 Subject: [PATCH] - use a different approach here since oracle isn't doing it either, just round it --- lib/sqlalchemy/testing/suite/test_types.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py index d04829a79b..3eb105ba3c 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): -- 2.47.3