The problem is that checkrate is defined outside of the loop, so
there's only one checkrate function, whose description is changed each
time through the loop. Since nose isn't caching the description (which
is probably a bug), when the description is looked up again when error
output is printed at the end of the test run, the description for each
test will (as you saw) be the last thing that checkrate.description
was set to.
In the near term, you can fix this by moving the checkrate function
definition inside the innermost loop. Longer term, if you could report
this as a bug in nose's tracker, I'll try to get it fixed for the next
release.
JP
> Sure. Can I just copy in my original message, or do you need a
> standalone case that demonstrates it?
The message is fine.
> "nosetests mytest.TestStuff" runs nothing. I would expect it to run
> the function TestStuff().
nose requires that you explicitly indicate the module:callable
boundary in a test name with a colon, so the way to do what you want
to do is:
nosetests mytest:TestStuff
nosetests mytest:Test1.testa
There are complicated reasons for this, but the simple one is that
given the much wider variety of things that nose considers a valid
test name relative to unittest, it winds up being much simpler for
users (and nose developers) if nose doesn't try to guess at what part
of a name is probably a file on disc and what part is probably
something in that file.
JP