summaryrefslogtreecommitdiff
path: root/nose
diff options
context:
space:
mode:
authorJohn Szakmeister <john@szakmeister.net>2014-02-19 18:57:08 -0500
committerJohn Szakmeister <john@szakmeister.net>2014-02-20 05:04:55 -0500
commitc51ff6ffda7e8b36eaa1152090e6238479610d7d (patch)
tree8ac32f2c292e841d378b85bf87c9b50e0413e670 /nose
parent023124f42b9e49c105a077dbb2416c64eb0e9f32 (diff)
downloadnose-c51ff6ffda7e8b36eaa1152090e6238479610d7d.tar.gz
Fix #728: attrib plugin rejects any staticmethod
The issue is that static methods get wrapped in an UnboundMethod object, and the attribute plugin is unable to grab the associated class, since UnboundMethod does not have the im_class attribute. Since the goal of UnboundMethod is to mimic an actual method, let's go ahead and implement the im_class attribute.
Diffstat (limited to 'nose')
-rw-r--r--nose/pyversion.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/nose/pyversion.py b/nose/pyversion.py
index 07c105f..fba5ada 100644
--- a/nose/pyversion.py
+++ b/nose/pyversion.py
@@ -89,6 +89,7 @@ class UnboundMethod:
self.__dict__ = func.__dict__.copy()
self._func = func
self.__self__ = UnboundSelf(cls)
+ self.im_class = cls
def address(self):
cls = self.__self__.cls