def patchInstallReactor(self):
        """
        Patch C{_options.installReactor} so we can capture usage and prevent
        actual installs.
        """
        self.installedReactors = {}

        def installReactor(_, name):
            reactor = MemoryReactor()
            self.installedReactors[name] = reactor
            return reactor

        self.patch(TwistOptions, "installReactor", installReactor)

        Patch C{_options.installReactor} so we can capture usage and prevent
        actual installs.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/twist/test/test_twist.py