← Back to team overview

testtools-dev team mailing list archive

Re: [Merge] lp:~gz/testtools/raises_regressions_675327 into lp:testtools

 

So lets go back to basics.

The goal of the printed output is twofold I think:
 - diagnosing failures
 - being able to tell what was actually passed into constructors.

The exact formatting doesn't have to match across different Python
versions: its primarily important that whats written in the source
matches whats shown in the output in some unambiguous fashion.

Its a shame that socket.error (which is _socket.error) renders badly,
but thats not the default:

>>> class foo(Exception):
...   pass
...
>>> foo
<class '__main__.foo'>

The instance repr is generally sad :(

>>> repr(foo('do'))
"foo('do',)"

I'm not entirely sure what we should do here, but overriding the built
in repr seems undesirable to me.
-- 
https://code.launchpad.net/~gz/testtools/raises_regressions_675327/+merge/41342
Your team testtools developers is requested to review the proposed merge of lp:~gz/testtools/raises_regressions_675327 into lp:testtools.



References