[TIP] What to do when a test is stuck
yoavglazner at gmail.com
Mon Sep 7 23:40:46 PDT 2009
Nope, this waits untill the test is done and then makes it fail if the
time_taken > limit
my test might get stuck... (i'm using COM so i can never know...).
On Mon, Sep 7, 2009 at 6:44 PM, Doug Latornell <doug at sadahome.ca> wrote:
> See nose.tools.timed
> On Mon, Sep 7, 2009 at 6:28 AM, yoav glazner<yoavglazner at gmail.com> wrote:
> > Hi,
> > I'm using Nose with Pymock.
> > I have some tests that could result in an endless loop.
> > how can termenate it after some time if no result was given?
> > i wonder if there is a decorator for these things, something like:
> > @time_limit(5) # now this test should fail.
> > def testMylooping(self):
> > while(True):
> > assert 1+1 == 2 ,'python told me that 1+1 != 2!!!'
> > Thanks,
> > Yoav.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python