[TIP] Nose bug? using inspect.ismethod too aggressive?

Kumar McMillan kumar.mcmillan at gmail.com
Sun Sep 20 13:05:11 PDT 2009

On Sun, Sep 20, 2009 at 1:05 AM, Fernando Perez <fperez.net at gmail.com> wrote:
> But inspect.ismethod() returns false for staticmethods, while unittest
> accepts them (and I need that for my use case).
> It seems to me that this is a nose bug, fixable with:
> -            if not ismethod(item):
> +            if not hasattr(item,'__call__'):
> I'll try to monkeypatch it in the meantime, but it would be great to
> have this done upstream, if it's indeed seen as a bug.

Seems like there is an edge case here that can possibly be fixed.
However, I tried applying your patch and got 3 failed tests in the
loader.  If you want to hack on it, the test suite is easy to run:

hg cloning instructions here:

$ cd nose
$ python setup.py egg_info
$ python2.5 selftest.py
$ python2.6 selftest.py

> thanks!
> f
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python

More information about the testing-in-python mailing list