def test_profilePrintStatsError(self):
        class ErroneousProfile(profile.Profile):
            def print_stats(self):
                raise RuntimeError("Boom")
        self.patch(profile, "Profile", ErroneousProfile)

        config = twistd.ServerOptions()
        config["profile"] = self.mktemp()
        config["profiler"] = "profile"
        profiler = app.AppProfiler(config)
        reactor = DummyReactor()

        oldStdout = sys.stdout
        self.assertRaises(RuntimeError, profiler.run, reactor)
        self.assertIdentical(sys.stdout, oldStdout)
When an error happens during the print of the stats, C{sys.stdout}
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/test/test_twistd.py/AppProfilingTestCase.test_profilePrintStatsError