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

Method test_get_stats_profile

Lib/test/test_pstats.py:135–152  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

133 'calls')
134
135 def test_get_stats_profile(self):
136 def pass1(): pass
137 def pass2(): pass
138 def pass3(): pass
139
140 pr = cProfile.Profile()
141 pr.enable()
142 pass1()
143 pass2()
144 pass3()
145 pr.create_stats()
146 ps = pstats.Stats(pr)
147
148 stats_profile = ps.get_stats_profile()
149 funcs_called = set(stats_profile.func_profiles.keys())
150 self.assertIn('pass1', funcs_called)
151 self.assertIn('pass2', funcs_called)
152 self.assertIn('pass3', funcs_called)
153
154 def test_SortKey_enum(self):
155 self.assertEqual(SortKey.FILENAME, 'filename')

Callers

nothing calls this directly

Calls 6

create_statsMethod · 0.95
get_stats_profileMethod · 0.95
setFunction · 0.85
assertInMethod · 0.80
enableMethod · 0.45
keysMethod · 0.45

Tested by

no test coverage detected