[py-dev] py.test tracing within generators

François Pinard pinard at iro.umontreal.ca
Fri Oct 21 22:23:46 CEST 2005


Hi, people.

When a test is launched and fails, after the effect of a generative
test, it would be useful if the stack trace somehow included an
indication about which line was active within the generator.  Either the
``yield`` line contents, or its location within the generator, may give
good clues about what the real test is, or is about.

For now, I yield to the real test function strings containing Python
expressions, to be later eval'ed within the real test function, and also
used as second argument to ``assert``.  In this way, py.test displays
the information I need in the stack trace.  But this is a bit of a
stunt, which would be nicer if avoided.

We all know how easy it is, for a user like me, making such suggestions,
while they are likely difficult to implement.  So, I well understand
that this particular suggestion may not be reasonable.  Yet, with some
luck, there might be tricks you know and I do not even suspect! :-)

-- 
François Pinard   http://pinard.progiciels-bpi.ca


More information about the py-dev mailing list