-
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
AttributeError: 'ContextSuite' has no attribute 'capturedOutput' in 0.10.3 #23
Comments
0.10.3 is a very old version. Can you verify that this bug still exists in the Google Code Info: |
AttributeError: 'ContextSuite' object has no attribute 'capturedOutput' We were getting the same error when using the teamcity-nose and teamcity-messages plugin. Using Python 2.6. Tested with the latest nose 1.0.0 on pypi, and tip at https://bitbucket.org/jpellerin/nose/ changeset 780: 6318b0c855a6 Fixed it a little differently than yanegomi. Patch attached. The code will still pass through the error data to the teamcity plugin, so that the error gets printed in the teamcity service message, and you will know what failed. nat_linden kindly made a fork from nose tip, with the patch here: https://bitbucket.org/nat_linden/nose/ thanks Google Code Info: |
whoops, this issue wasn't tagged with the patch so we lost track of it. Thanks for updating the patch. If you can add a test that reproduces the error then it would greatly speed up getting the patch applied. There is info in DEVELOPERS.txt for how to run the tests. Google Code Info: |
Thanks Kumar. I believe the issue occurs when you have a nose plugin using the old plugin api (0.9) which goes through the ZeroNinePlugin code. The test script has a setup function, rather than a method of a unittest.TestCase subclass. If there is a failure during the setup function, the test object has no capturedOutput attribute, nor does it have a test attribute (test.test). I'll work on making a unit test case that simulates this condition. If useful, here are some manual steps to reproduce:
Test cases which are not subclasses of unittest.TestCasewith a setup function which will raise an Exceptiondef setup(): def test_one(): def test_two(): print "testtwo"
Google Code Info: |
I came across the following issue with our custom output plugin for nose
when an Exception occurred when running setUp in a nose context suite:
Traceback (most recent call last):
File "/ws/garrcoop-sjc/tools/bin/nosetests", line 7, in ?
sys.exit(
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/core.py",
line 219, in init
argv=argv, testRunner=testRunner, testLoader=testLoader)
File "/ws/garrcoop-sjc/tools///lib/python2.4/unittest.py", line 759, in
init
self.runTests()
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/core.py",
line 298, in runTests
result = self.testRunner.run(self.test)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/core.py",
line 62, in run
test(result)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 132, in call
return self.run(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 162, in run
test(orig)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 132, in call
return self.run(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 162, in run
test(orig)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 132, in call
return self.run(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 162, in run
test(orig)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 132, in call
return self.run(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/suite.py",
line 152, in run
result.addError(self, self.exc_info())
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/proxy.py",
line 120, in addError
plugins.addError(self.test, err)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/plugins/manager.py",
line 81, in call
return self.call(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/plugins/manager.py",
line 145, in simple
result = meth(_arg, *_kw)
File
"/thumper/sanity/pynt/usr/lib/python2.4/site-packages/nose-0.10.3.p1-py2.4.egg/nose/plugins/manager.py",
line 303, in addError
capt = test.capturedOutput
AttributeError: 'ContextSuite' object has no attribute 'capturedOutput'
The attached patch fixed that issue, but it's odd why a ContextSuite is
being misinterpreted at this level...
Google Code Info:
Issue #: 296
Author: [email protected]
Created On: 2009-10-16T10:47:44.000Z
Closed On:
The text was updated successfully, but these errors were encountered: