def test_exitMessageNonZero(self):
        """
        L{exit} given a non-zero status code writes the given message to
        standard error.
        """
        out = NativeStringIO()
        self.patch(_exit, "stderr", out)

        message = "Hello, world."
        exit(64, message)

        self.assertEqual(out.getvalue(), message + "\n")

        L{exit} given a non-zero status code writes the given message to
        standard error.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/application/runner/test/test_exit.py