nose-devs/nose — Issue #10: test generators description attribute not cached for failed tests
Author: jpellerin
Created: 2011-12-14 15:54:39+00:00
State: open

What steps will reproduce the problem?

from nose.tools import *

def check(a,b):
assert_equal(a,b)

def test_generator():
check.description = 'test_fails'
yield check, 1, 2

check.description = 'test_passes'
yield check, 1, 1

# save as test.py in ./, run nosetests

What is the expected output? What do you see instead?

I would like to see:

$ nosetests
F.
======================================================================
FAIL: test_fails
----------------------------------------------------------------------

instead I see:

$ nosetests
F.
======================================================================
FAIL: test_passes
----------------------------------------------------------------------

What version of the product are you using? On what operating system?

10.4 on kubuntu intrepid

Please provide any additional information below.

Thank you for a very useful unit testing package. The test generators are
very helpful, but there is a small problem in that the failure report does
not list the function.description from the time of the failure, but rather
the last description that was registered during execution.

Google Code Info:
Issue #: 244
Author: dsdal...@gmail.com
Created On: 2009-03-07T15:53:40.000Z
Closed On: