Created
January 5, 2016 15:44
-
-
Save boblefrag/85bf36c458a11b384a31 to your computer and use it in GitHub Desktop.
get the test ordered by time execution for NoseTest
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
from lxml import etree | |
tree = etree.parse("<path to nosetests.xml>") | |
results = [] | |
for t in tree.xpath("/testsuite/testcase"): | |
result = {"class": t.get('classname'), | |
"name": t.get('name'), | |
"time": t.get('time')} | |
results.append(result) | |
results = sorted(results, key=lambda k: k['time'], reverse=True) | |
for result in results: | |
print "{class}.{name} : {time}".format(**result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment