denisenkom / pytds

Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation
MIT License
192 stars 53 forks source link

Large decimal values result in errors if the ambient decimal context does not have a high enough precision #90

Closed LHCGreg closed 6 years ago

LHCGreg commented 6 years ago

Discovered this as a result of some decimal-related tests in connected_tests.py failing if running only the tests on connected_tests.py, not all the tests, using pytest tests/connected_test.py. all_test.py sets getcontext().prec = 38, which gets run before connected_tests.py if you are running all the tests, but does not get run if you are running only the tests in connected_tests.py. pytds should behave correctly with the default decimal context.

PR incoming.