rlisagor / freshen

Clone of the Cucumber BDD framework for Python
GNU General Public License v3.0
355 stars 56 forks source link

Captured test output not being output on failure #46

Open PeterJCLaw opened 10 years ago

PeterJCLaw commented 10 years ago

If you have a simple nose test:

def test_nothing():
   print 'some debug message'
   fail()

then when running this with nose, you get:

$ nosetests
<snip>
NameError: global name 'fail' is not defined
-------------------- >> begin captured stdout << ---------------------
bacon

--------------------- >> end captured stdout << ----------------------
<snip>
FAILED (errors=1)

However, if you have --with-freshen enabled the lines containing the captured standard out never appear, either for code run as part of a freshen test, or even just as part of standard nose tests.

This makes debugging the failing tests substantially harder, as it's much harder to see why they fail. Disabling output capture with --nocapture does allow the output to appear, but removes the beneficial grouping of it by test case that would otherwise be had.