def test_timeoutCancels(self):
        result = Deferred()
        error = []
        result.addErrback(error.append)

        @self.eventloop.wait_for(timeout=0.0)
        def times_out():
            return result
        self.assertRaises(TimeoutError, times_out)
        self.assertIsInstance(error[0].value, CancelledError)
If a function wrapped with wait_for hits the timeout, it cancels
dataset/ETHPy150Open itamarst/crochet/crochet/tests/test_api.py/WaitForTests.test_timeoutCancels