def test_noCanceller(self):
        """
        A L{defer.Deferred} without a canceller must errback with a
        L{defer.CancelledError} and not callback.
        """
        d = defer.Deferred()
        d.addCallbacks(self._callback, self._errback)
        d.cancel()
        self.assertEqual(self.errbackResults.type, defer.CancelledError)
        self.assertIsNone(self.callbackResults)

        A L{defer.Deferred} without a canceller must errback with a
        L{defer.CancelledError} and not callback.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_defer.py