import decimal
class _MSNumeric_pyodbc(sqltypes.Numeric):
- """Turns Decimals with adjusted() < -6 or > 7 into strings.
+ """Turns Decimals with adjusted() < 0 or > 7 into strings.
This is the only method that is proven to work with Pyodbc+MSSQL
without crashing (floats can be used but seem to cause sporadic
isinstance(value, decimal.Decimal):
adjusted = value.adjusted()
- if adjusted < -6:
+ if adjusted < 0:
return self._small_dec_to_string(value)
elif adjusted > 7:
return self._large_dec_to_string(value)
def teardown(self):
metadata.drop_all()
- @testing.crashes('mssql+pyodbc', 'FIXME: no clue what is up here.')
@testing.fails_on_everything_except('mssql+pyodbc', 'this is some pyodbc-specific feature')
def test_decimal_notation(self):
import decimal