def _cleanReactor(self):
        """
        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        """
        reactor = self._getReactor()
        selectableStrings = []
        for sel in reactor.removeAll():
            if interfaces.IProcessTransport.providedBy(sel):
                sel.signalProcess('KILL')
            selectableStrings.append(repr(sel))
        return selectableStrings

        Remove all selectables from the reactor, kill any of them that were
        processes, and return their string representation.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/trial/util.py