def test_exitWithSignal(self):
        """
        exitWithSignal replaces the existing signal handler with the default
        handler and sends the replaced signal to the current process.
        """

        fakeSignalArgs = [None, None]

        def fake_signal(sig, handler):
            fakeSignalArgs[0] = sig
            fakeSignalArgs[1] = handler

        self.patch(signal, 'signal', fake_signal)
        app._exitWithSignal(signal.SIGINT)

        self.assertEquals(fakeSignalArgs[0], signal.SIGINT)
        self.assertEquals(fakeSignalArgs[1], signal.SIG_DFL)
        self.assertEquals(self.fakeKillArgs[0], os.getpid())
        self.assertEquals(self.fakeKillArgs[1], signal.SIGINT)

        exitWithSignal replaces the existing signal handler with the default
        handler and sends the replaced signal to the current process.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py