nose-devs/nose — Issue #361: nose does not properly handle class decorated tests
Author: jpellerin
Created: 2011-12-14 16:09:07+00:00
State: open

Not to be confused with class decorators.

What steps will reproduce the problem?
1. Create a decorator as a class:

class decorate:
def __init__(self, func):
self.func = func
def __call__(self):
return self.func()

2. Decorate a test with this class:
@decorate
def simple_test():
assert True, 'This will always pass'

3. Run nose:

----------------------------------------------------------------------
Ran 0 tests in 0.001s

OK

What is the expected output? What do you see instead?
Should discover two tests. Does not discover any

What version of the product are you using? On what operating system?
Happens with nose 0.11.* and hg tip.

Please provide any additional information below.
See documentation on class based decorators here:
http://uswaretech.com/blog/2009/06/understanding-decorators/

Note that the class based decorators cannot decorate instance methods, only
functions.

Google Code Info:
Issue #: 315
Author: dragonst...@gmail.com
Created On: 2010-01-01T02:19:51.000Z
Closed On: