Created
October 17, 2012 18:53
-
-
Save mkorpela/3907371 to your computer and use it in GitHub Desktop.
Script to help in Robot Framework test optimization
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cProfile | |
import pstats | |
from robot.run import run_cli | |
import os, sys | |
import tempfile | |
profile_results = tempfile.mktemp(suffix='.out', prefix='pybot-profile', dir='.') | |
cProfile.run('run_cli(sys.argv[1:])', profile_results) | |
stats = pstats.Stats(profile_results) | |
stats.sort_stats('cumulative').print_stats(50) | |
os.remove(profile_results) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment