3 Prints 10 longest lasting tests from JSON PHPUnit log
6 from __future__
import print_function
12 with
open(filename
) as handle
:
13 content
= handle
.read()
15 '[' + content
.replace('}{', '},{') + ']'
17 printed
= ['test', 'status', 'time']
18 tests
= [item
for item
in data
if item
['event'] == 'test']
19 for test
in sorted(tests
, key
=lambda item
: -item
['time'])[:10]:
21 print('{0:10s}: {1}'.format(item
, test
[item
]))
25 if __name__
== '__main__':