[IPython-dev] How to organize test code

Jörgen Stenarson jorgen.stenarson at kroywen.se
Tue Jun 12 15:23:45 EDT 2012


Hi,

I'm working on the python3 failures on windows and have a general 
question regarding test code.

One of the failing tests is test_history. This is a very long test 
function with many asserts. All these asserts are surrounded with a try 
finally block. I believe this is causing some problems when debugging a 
failure. When running iptest --pdb I get into the traceback but the 
stack is messed up and I end up in the finally clause instead of the 
actual failure point. The many asserts makes it difficult to guess which 
one was responsible for the failure.

What do you think about rewriting this using a class and proper 
setUp/tearDown methods instead?




More information about the IPython-dev mailing list