diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 17:44:46 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-11 17:44:46 -0500 |
commit | c691b4cbdf7424964f49ac2fd05057514e5856a3 (patch) | |
tree | a4d62e1d5c0e63c90fd1b5ce125928d7a86852c6 /test/dialect/test_postgresql.py | |
parent | b88c54f95be3e3bc2e0923181d56862fa3fda9fa (diff) | |
download | sqlalchemy-c691b4cbdf7424964f49ac2fd05057514e5856a3.tar.gz |
- support for cdecimal
- add --with-cdecimal flag to tests, monkeypatches cdecimal in
- fix mssql/pyodbc.py to not use private '_int' accessor in decimal conversion
routines
- pyodbc version 2.1.8 is needed for cdecimal in any case as
previous versions also called '_int', 2.1.8 adds the same string
logic as our own dialect, so that logic is skipped for modern
pyodbc version
- make the imports for "Decimal" consistent across the whole lib. not sure
yet how we should be importing "Decimal" or what the best way forward
is that would allow a clean user-invoked swap of cdecimal; for now,
added docs suggesting a global monkeypatch - the two decimal libs
are not compatible with each other so any chance of mixing produces
serious issues. adding adapters to DBAPIs tedious and adds in-python
overhead. suggestions welcome on how we should be doing
Decimal/cdecimal.
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r-- | test/dialect/test_postgresql.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py index bff1fba68..cfccb9bb1 100644 --- a/test/dialect/test_postgresql.py +++ b/test/dialect/test_postgresql.py @@ -2,12 +2,12 @@ from test.lib.testing import eq_, assert_raises, assert_raises_message from test.lib import engines import datetime -import decimal from sqlalchemy import * from sqlalchemy.orm import * from sqlalchemy import exc, schema, types from sqlalchemy.dialects.postgresql import base as postgresql from sqlalchemy.engine.strategies import MockEngineStrategy +from sqlalchemy.util.compat import decimal from test.lib import * from test.lib.util import round_decimal from sqlalchemy.sql import table, column @@ -480,7 +480,7 @@ class NumericInterpretationTest(TestBase): def test_numeric_codes(self): from sqlalchemy.dialects.postgresql import pg8000, psycopg2, base - from decimal import Decimal + from sqlalchemy.util.compat import decimal for dialect in (pg8000.dialect(), psycopg2.dialect()): @@ -491,7 +491,7 @@ class NumericInterpretationTest(TestBase): val = 23.7 if proc is not None: val = proc(val) - assert val in (23.7, Decimal("23.7")) + assert val in (23.7, decimal.Decimal("23.7")) class InsertTest(TestBase, AssertsExecutionResults): |