def patchExit(self):
        """
        Patch L{_twist.exit} so we can capture usage and prevent actual exits.
        """
        self.exit = DummyExit()
        self.patch(_options, "exit", self.exit)

        Patch L{_twist.exit} so we can capture usage and prevent actual exits.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/twist/test/test_options.py