MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _run_with_profile

Method _run_with_profile

examples/performance/__init__.py:289–300  ·  view source on GitHub ↗
(self, fn, sort)

Source from the content-addressed store, hash-verified

287 self.stats[-1].report()
288
289 def _run_with_profile(self, fn, sort):
290 pr = cProfile.Profile()
291 pr.enable()
292 try:
293 result = fn(self.num)
294 finally:
295 pr.disable()
296
297 stats = pstats.Stats(pr)
298
299 self.stats.append(TestResult(self, fn, stats=stats, sort=sort))
300 return result
301
302 def _run_with_time(self, fn):
303 now = time.time()

Callers 1

_run_testMethod · 0.95

Calls 2

TestResultClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected