- Work around a regression in Python 3.3 for `colander.Decimal
` when it's
used with a ``quant`` argument but without a ``rounding`` argument. See https://github.com/Pylons/colander/issues/66 - Add Python 3.3 to tox configuration and use newer tox testing regime (setup.py dev). Closes #66
This commit is contained in:
16
CHANGES.txt
16
CHANGES.txt
@@ -1,3 +1,19 @@
|
||||
Next release
|
||||
------------
|
||||
|
||||
Bug Fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- Work around a regression in Python 3.3 for ``colander.Decimal`` when it's
|
||||
used with a ``quant`` argument but without a ``rounding`` argument.
|
||||
See https://github.com/Pylons/colander/issues/66
|
||||
|
||||
Features
|
||||
~~~~~~~~
|
||||
|
||||
- Add Python 3.3 to tox configuration and use newer tox testing regime
|
||||
(setup.py dev).
|
||||
|
||||
0.9.9 (2012-09-24)
|
||||
------------------
|
||||
|
||||
|
@@ -1086,10 +1086,11 @@ class Decimal(Number):
|
||||
returned.
|
||||
|
||||
The Decimal constructor takes two optional arguments, ``quant`` and
|
||||
``rounding``. If supplied, ``quant`` should be a string. If supplied,
|
||||
``rounding`` should be one of the Python ``decimal`` module rounding
|
||||
options (e.g. ``decimal.ROUND_UP``, ``decimal.ROUND_DOWN``, etc). The
|
||||
serialized and deserialized result will be quantized and rounded via
|
||||
``rounding``. If supplied, ``quant`` should be a string,
|
||||
(e.g. ``1.00``). If supplied, ``rounding`` should be one of the Python
|
||||
``decimal`` module rounding options (e.g. ``decimal.ROUND_UP``,
|
||||
``decimal.ROUND_DOWN``, etc). The serialized and deserialized result
|
||||
will be quantized and rounded via
|
||||
``result.quantize(decimal.Decimal(quant), rounding)``. ``rounding`` is
|
||||
ignored if ``quant`` is not supplied.
|
||||
|
||||
@@ -1106,7 +1107,10 @@ class Decimal(Number):
|
||||
def num(self, val):
|
||||
result = decimal.Decimal(str(val))
|
||||
if self.quant is not None:
|
||||
result = result.quantize(self.quant, self.rounding)
|
||||
if self.rounding is None:
|
||||
result = result.quantize(self.quant)
|
||||
else:
|
||||
result = result.quantize(self.quant, self.rounding)
|
||||
return result
|
||||
|
||||
class Money(Decimal):
|
||||
|
13
tox.ini
13
tox.ini
@@ -1,10 +1,11 @@
|
||||
[tox]
|
||||
envlist =
|
||||
py26,py27,py32,pypy,cover
|
||||
py26,py27,py32,py33,pypy,cover
|
||||
|
||||
[testenv]
|
||||
commands =
|
||||
python setup.py test -q
|
||||
python setup.py dev
|
||||
python -Wd setup.py test -q
|
||||
|
||||
[testenv:cover]
|
||||
basepython =
|
||||
@@ -12,12 +13,4 @@ basepython =
|
||||
commands =
|
||||
python setup.py nosetests --with-xunit --with-xcoverage
|
||||
deps =
|
||||
nose
|
||||
coverage==3.4
|
||||
nosexcover
|
||||
|
||||
# we separate coverage into its own testenv because a) "last run wins" wrt
|
||||
# cobertura jenkins reporting and b) pypy and jython can't handle any
|
||||
# combination of versions of coverage and nosexcover that i can find.
|
||||
# coverage==3.4 is required by nosexcover
|
||||
|
||||
|
Reference in New Issue
Block a user