File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change
1
+ import json
1
2
import logging
2
3
import os
3
4
from collections import Counter
@@ -105,8 +106,18 @@ def main(
105
106
}
106
107
)
107
108
continue
108
- report = load_dataset ("json" , data_files = report_file , split = "train" ) # type: ignore
109
- tests = {x ["nodeid" ]: x ["call" ] for x in report ["tests" ][0 ] if "call" in x } # type: ignore
109
+ with open (report_file , "r" ) as file :
110
+ report = json .load (file )
111
+ # new version of pytest json
112
+ if "created" in report :
113
+ tests = {x ["nodeid" ]: x ["call" ] for x in report ["tests" ] if "call" in x }
114
+ # old version of pytest json
115
+ else :
116
+ tests = {
117
+ x ["nodeid" ]: {"outcome" : x ["outcome" ], "duration" : x ["duration" ]}
118
+ for x in report
119
+ if x ["when" ] == "call"
120
+ }
110
121
status = []
111
122
runtimes = []
112
123
no_runs = 0
You can’t perform that action at this time.
0 commit comments