Beispiel #1
0
    def test_profile(self):
        prof = Profiler()
        prof.start()
        try:
            Tester1().t1()
        finally:
            prof.done()

        self.assertNotEqual(os.path.getsize('python-profiler-result.jandy'), 0)
        with open("python-profiler-result.jandy", "r") as file:
            trans = TFileObjectTransport(file)
            context = ProfilingContext()
            context.read(TJSONProtocol(trans))

        print(context)
        self.assertIsNotNone(context.root)