def testBadDelay(self): lc = task.LoopingCall(lambda: None) self.assertRaises(ValueError, lc.start, -1) # Make sure that LoopingCall.stop() prevents any subsequent calls.