[TIP] Context Sensitive Traceback in nosetests Error

jason pellerin jpellerin at gmail.com
Mon Jul 18 06:31:48 PDT 2011


Here:

>         for arg in sys.argv:
>             if arg == '--mysql':
>                 return (ec, '\n'.join([str(ev), tbinfo]), tb, 'myql')
>             elif arg == '--psql':
>                 return (ec, '\n'.join([str(ev), tbinfo]), tb, 'psql')

It looks like you're returning the info you want to see as an extra
term in the tuple, but that won't work because later users of the
tuple only care about the first 3 terms. What you need to do is,
following the example of the capture/logcapture/assert inspectiong
plugins, append the info that you want to the middle term in the tuple
(as you're doing with tbinfo).

JP



More information about the testing-in-python mailing list