test_ok2/bench/bench.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
341 B
Python
Raw Normal View History

import sys
if __name__ == "__main__":
import cProfile
import pstats
2018-05-23 22:48:46 +08:00
import pytest # NOQA
script = sys.argv[1:] if len(sys.argv) > 1 else ["empty.py"]
cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
p = pstats.Stats("prof")
p.strip_dirs()
p.sort_stats("cumulative")
2014-10-06 19:37:57 +08:00
print(p.print_stats(500))