summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/sql/sqltypes.py2
-rw-r--r--lib/sqlalchemy/testing/suite/test_types.py18
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py
index 7a3c50549..06b5e5c19 100644
--- a/lib/sqlalchemy/sql/sqltypes.py
+++ b/lib/sqlalchemy/sql/sqltypes.py
@@ -2604,7 +2604,7 @@ MATCHTYPE = MatchType()
_type_map = {
int: Integer(),
- float: Numeric(),
+ float: Float(),
bool: BOOLEANTYPE,
decimal.Decimal: Numeric(),
dt.date: Date(),
diff --git a/lib/sqlalchemy/testing/suite/test_types.py b/lib/sqlalchemy/testing/suite/test_types.py
index ee757e1ca..de32e77a4 100644
--- a/lib/sqlalchemy/testing/suite/test_types.py
+++ b/lib/sqlalchemy/testing/suite/test_types.py
@@ -431,6 +431,24 @@ class NumericTest(_LiteralRoundTripFixture, fixtures.TestBase):
filter_=lambda n: n is not None and round(n, 5) or None
)
+ @testing.fails_on("mysql", "until we do #4020")
+ def test_float_coerce_round_trip(self):
+ expr = 15.7563
+
+ val = testing.db.scalar(
+ select([literal(expr)])
+ )
+ eq_(val, expr)
+
+ # TODO: this one still breaks on MySQL
+ # def test_decimal_coerce_round_trip(self):
+ # expr = decimal.Decimal("15.7563")
+ #
+ # val = testing.db.scalar(
+ # select([literal(expr)])
+ # )
+ # eq_(val, expr)
+
@testing.requires.precision_numerics_general
def test_precision_decimal(self):
numbers = set([