-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test generators description attribute not cached for failed tests #10
Comments
This is a useful workaround: from nose.tools import * import copy def check(a,b): def test_generator():
Google Code Info: |
For a few other ways to work around this issue see this post: http://achinghead.com/archive/85/nosetests-generators-descriptions/ Google Code Info: |
Actually this doesn't work when using the multiprocess plugin because the function re-loaded in the new process is actually 'partial' without the arguments, so nothing is called. As #2 pointed, there is an alternative that uses classes, but this also suffers from problems when used with multiprocess. The reason is because the default makeTests function recognizes it is a 'class' and tries to load all its methods, even though the class is callable. In order to circumvent this, it would be great if python nose recognized callable classes and treated that as functions instead of trying to load their methods (not sure if there are any compatibility issues here). I am attaching a very short plugin called CallableClass that does this. It is enabled with --with-callableclass. rosen diankov, Google Code Info: |
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
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: [email protected]
Created On: 2009-03-07T15:53:40.000Z
Closed On:
The text was updated successfully, but these errors were encountered: