def test_anotherRunning(self):
        """
        Another running twistd server causes a system exit.
        """
        pidfile = self.mktemp()
        with open(pidfile, "w") as f:
            f.write("42")
        def kill(pid, sig):
            pass
        self.patch(os, "kill", kill)
        e = self.assertRaises(SystemExit, checkPID, pidfile)
        self.assertIn("Another twistd server", e.code)

        Another running twistd server causes a system exit.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_twistd.py