MCPcopy Index your code
hub / github.com/python/cpython / test_cprofile

Method test_cprofile

Lib/test/test_profile.py:55–70  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 return results
54
55 def test_cprofile(self):
56 results = self.do_profiling()
57 expected = self.get_expected_output()
58 self.assertEqual(results[0], 1000)
59 fail = []
60 for i, method in enumerate(self.methodnames):
61 a = expected[method]
62 b = results[i+1]
63 if a != b:
64 fail.append(f"\nStats.{method} output for "
65 f"{self.profilerclass.__name__} "
66 "does not fit expectation:")
67 fail.extend(unified_diff(a.split('\n'), b.split('\n'),
68 lineterm=""))
69 if fail:
70 self.fail("\n".join(fail))
71
72 def test_calling_conventions(self):
73 # Issue #5330: profile and cProfile wouldn't report C functions called

Callers

nothing calls this directly

Calls 10

do_profilingMethod · 0.95
get_expected_outputMethod · 0.95
unified_diffFunction · 0.90
enumerateFunction · 0.85
assertEqualMethod · 0.45
appendMethod · 0.45
extendMethod · 0.45
splitMethod · 0.45
failMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected