nose-devs/nose — Issue #114: Cannot yield a `functools.partial` from a test generator
Author: jpellerin
Created: 2011-12-14 15:59:43+00:00
State: open

When trying to `yield` a `functools.partial` in a test generator, Nose throws an error.

For example, given code like this:

from functools import partial
def test_foo():
yield (partial(sum, 1), 2)

There will be an explosion like this:

ERROR: Failure: TypeError ( is not a function or method)
----------------------------------------------------------------------
Traceback (most recent call last):
File ".../nose/failure.py", line 39, in runTest
raise self.exc_class(self.exc_val)
TypeError: is not a function or method

This is with version 0.11.4.

(possibly the test generator should only check to see if the first element of the yielded tuple is `callable(...)`?)

Google Code Info:
Issue #: 362
Author: wole...@gmail.com
Created On: 2010-09-08T16:00:53.000Z
Closed On: