On 06 Feb 01:00, Cédric Krier wrote:
> Hi,
> 
> With the recent drop of Python 2.6, I re-wrote the scenario to get
> better error message like this [1]. It allowed to find some misbehavior
> between PostgreSQL and SQLite.
> The problem is that MySQL again doesn't play well [2] because we have to
> put constraint on the DECIMAL column [3] and MySQL doesn't succeed to
> return Decimal with the same precision as we send.
> I thought about using Decimal.normalize() [4] to get standard format to
> test in doctest but I don't like too much because it will hide other
> issues (like the one fixed with this change for SQLite).
> 
> So I'm calling for ideas…

So I'm thinking about skipping all doctest with MySQL backend because in
some way, it is just the unittest that really should check the internal
behavior of the code and scenario are just there for the big picture
workflow (and so they should not depend on the backend).

> [1] http://hg.tryton.org/modules/account/rev/3f5a5a854341#l4.1
> [2] http://tests.tryton.org/~test/mysql.html
> [3] 
> http://hg.tryton.org/trytond/file/631515bc8c82/trytond/model/fields/numeric.py#l31
> [4] http://docs.python.org/2/library/decimal.html#decimal.Decimal.normalize

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpxSKXXA1MvX.pgp
Description: PGP signature

Reply via email to