def test_active(self):
        """
        L{IDelayedCall.active} returns False once the call has run.
        """
        dcall = reactor.callLater(0.01, self.deferred.callback, True)
        self.assertTrue(dcall.active())

        def checkDeferredCall(success):
            self.assertFalse(dcall.active())
            return success

        self.deferred.addCallback(checkDeferredCall)

        return self.deferred

        L{IDelayedCall.active} returns False once the call has run.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_internet.py