def testSimpleHandlers(self): handlers = map(lambda _: Handler(self.signum), range(3)) self.assert_called([0, 0, 0], handlers) yield self.kill() self.assert_called([1, 1, 1], handlers) handlers[0].destroy() yield self.kill() self.assert_called([1, 2, 2], handlers) signal.reset()
def testLegacyHandler(self): legacy = Handler(self.signum, signal=python_signal) yield self.kill() self.assert_called([1], [legacy]) handler = Handler(self.signum) yield self.kill() self.assert_called([1, 2], [handler, legacy]) handler.destroy() yield self.kill() self.assert_called([1, 3], [handler, legacy]) handler2 = Handler(self.signum) self.assert_called([1, 3, 0], [handler, legacy, handler2]) yield self.kill() self.assert_called([1, 4, 1], [handler, legacy, handler2]) signal.reset() yield self.kill() self.assert_called([1, 5, 1], [handler, legacy, handler2])
def tearDown(self): time.reset() signal.reset()
def tearDown(self): log.test_reset() time.reset() signal.reset()