def test_errbackCancelledErrorOnCancel(self):
        """
        When C{D} cancelled, CancelledError from C{C} will be errbacked
        through C{D}.
        """
        d = self.sampleInlineCB()
        d.cancel()
        self.assertRaises(
            CancelledError,
            self.failureResultOf(d).raiseException,
        )

        When C{D} cancelled, CancelledError from C{C} will be errbacked
        through C{D}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_inlinecb.py