[SciPy-dev] Two new test failures

Fernando Perez fperez.net at gmail.com
Thu Nov 13 16:05:38 EST 2008


On Thu, Nov 13, 2008 at 12:45 PM,  <josef.pktd at gmail.com> wrote:

>>> The problem, I still didn't manage to figure out, is how and whether the
>>> knownfailureif decorator works with test generators, e.g.
>>>
>>> this is my test:
>>>
>>> @dec.knownfailureif(True, "This test is known to fail") def
>>> test_discrete_rvs_cdf_fail():
>> [clip]
>>>         yield check_discrete_chisquare, distname, arg
>> [clip]
>>> I get an error instead of a known failure which is not counted towards
>>> failures and errors.
>>>
>>> Is there a trick to get the decorators to work with generators or is
>>> this not possible?
>>
>> I think it will work if the decorators are applied to the _check methods
>> instead. But this seems like a bug in Nose -- it should catch SkipTest
>> raised already in the generator method, not only in functions yielded by
>> it.

I have to run now, but tomorrow I'll write back on this.  I've been
tracking down locally how to integrate decorators with test
generators, there's definitely a bug there.  Matthew Brett and I
worked on it and I have  kludgy but functional solution, and an
improved @skipif that can take a function as the test condition, and
that works with test generators.

I'll get back to you tomorrow with that code, and hopefully we can
work out the details until we have a clean solution to push back into
the numpy test decorators module.

Cheers,

f



More information about the SciPy-Dev mailing list