From 1358b8d2c22b2e4e9929a0e5de3602a411924fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 18 Jan 2011 21:02:56 +0100 Subject: [PATCH] Fix Decimal for doctest --- trytond/tests/test_tryton.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/trytond/tests/test_tryton.py b/trytond/tests/test_tryton.py index c8903cf7a7..df2373f1ef 100644 --- a/trytond/tests/test_tryton.py +++ b/trytond/tests/test_tryton.py @@ -11,6 +11,13 @@ DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, if os.path.isdir(DIR): sys.path.insert(0, os.path.dirname(DIR)) +if sys.version_info[:2] <= (2, 5): + # ugly monkeypatch to make doctests work. For the reasons see + # http://mail.python.org/pipermail/python-dev/2008-July/081420.html + # It can go away once we drop Python 2.5 + import decimal + decimal.Decimal.__repr__ = lambda s: "Decimal('%s')" % str(s) + import unittest import doctest from lxml import etree