def test_cancelCancelledDelayedCall(self):
        """
        Test that cancelling a DelayedCall which has already been cancelled
        raises the appropriate exception.
        """
        call = reactor.callLater(0, lambda: None)
        call.cancel()
        self.assertRaises(error.AlreadyCancelled, call.cancel)

        Test that cancelling a DelayedCall which has already been cancelled
        raises the appropriate exception.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_internet.py