nose-devs/nose — Issue #65: generator tests nested in methods not run properly
Author: jpellerin
Created: 2011-12-14 15:57:39+00:00
State: closed

Nose does not manage to run the following test:

class Test1(object):
def test_nested_generator(self):
def func():
pass
yield func,

Instead it produces the following exception:

Traceback (most recent call last):
File "/usr/bin/nosetests", line 8, in
load_entry_point('nose==0.9.2.dev-r6', 'console_scripts', 'nosetests')()
File "/home/antoine/nose-svn/nose/core.py", line 466, in main
return sys.exit(not run(*arg, **kw))
File "/home/antoine/nose-svn/nose/core.py", line 474, in run
result = TestProgram(*arg, **kw).success
File "/home/antoine/nose-svn/nose/core.py", line 203, in __init__
self.runTests()
File "/home/antoine/nose-svn/nose/core.py", line 231, in runTests
result = self.testRunner.run(self.test)
File "/home/antoine/nose-svn/nose/core.py", line 102, in run
result = unittest.TextTestRunner.run(self, test)
File "/usr/lib/python2.5/unittest.py", line 696, in run
test(result)
File "/home/antoine/nose-svn/nose/suite.py", line 40, in __call__
self.run(*arg, **kw)
File "/home/antoine/nose-svn/nose/suite.py", line 56, in run
test(result)
File "/home/antoine/nose-svn/nose/suite.py", line 40, in __call__
self.run(*arg, **kw)
File "/home/antoine/nose-svn/nose/suite.py", line 56, in run
test(result)
File "/home/antoine/nose-svn/nose/suite.py", line 40, in __call__
self.run(*arg, **kw)
File "/home/antoine/nose-svn/nose/suite.py", line 56, in run
test(result)
File "/home/antoine/nose-svn/nose/suite.py", line 40, in __call__
self.run(*arg, **kw)
File "/home/antoine/nose-svn/nose/suite.py", line 52, in run
for test in self._tests:
File "/home/antoine/nose-svn/nose/suite.py", line 98, in loadtests
yield MethodTestCase(self.cls, name, self.method, *arg)
File "/home/antoine/nose-svn/nose/case.py", line 99, in __init__
self.testCase = getattr(self.testInstance, method)
AttributeError: 'Test1' object has no attribute 'func'

Google Code Info:
Issue #: 6
Author: antoine....@gmail.com
Created On: 2006-12-19T12:13:56.000Z
Closed On: 2007-01-07T02:02:34.000Z