[py-dev] py.test munging strings in asserts?

holger krekel hpk at trillke.net
Sat Apr 22 15:17:01 CEST 2006


Hi Jan, hi Timothy, hi all, 

On Fri, Apr 21, 2006 at 12:16 +0200, Jan Balster wrote:
> The output is truncated to 240 characters, which is exactly the length of your
> strings in the output. The dots are only indicators, that the output was truncated.
> See py/test/terminal/terminal.py:439 and py/code/save_repr.py for explanations.
> As stated in the comments, we probably need a command line switch to toggle the
> behavior.

this was also discussed a bit on #pylib with carl ... i think 
we should rather not truncate the output by default unless 
we have a more exact method like showing diffs intelligently. 

The latter probably requires a bit of refactoring of exprinfo.py
which contains the "intermediate values representation" logic. 
It currently produces plain "explanation" strings from traversing
and evaluating the AST of the expression in question.  It should
probably produce more structured and more information-preserving 
information (maybe by producing string-like objects, Armin once 
produced a number of experiments for adding "color" meta 
information to strings seemlessly).  If we knew the binary
comparison operator in an assert expression then py.test 
could decide on methods how to show it. 

What do you think? 

best, 

    holger


More information about the py-dev mailing list