Debian Codegraph @

testing/web-platform/tests/tools/third_party/pytest/bench/bench.py

raw
1 import sys
2
3
4 if __name__ == "__main__":
5 import cProfile
6 import pstats
7
8 import pytest # noqa: F401
9
10 script = sys.argv[1:] if len(sys.argv) > 1 else ["empty.py"]
11 cProfile.run("pytest.cmdline.main(%r)" % script, "prof")
12 p = pstats.Stats("prof")
13 p.strip_dirs()
14 p.sort_stats("cumulative")
15 print(p.print_stats(500))