172 (data["id"], data["name"], data["description"]) |
172 (data["id"], data["name"], data["description"]) |
173 ) |
173 ) |
174 |
174 |
175 # test result |
175 # test result |
176 elif data["event"] == "result": |
176 elif data["event"] == "result": |
177 fn, ln = None, None |
177 filename, lineno = None, None |
178 tracebackLines = [] |
178 tracebackLines = [] |
179 if "traceback" in data: |
179 if "traceback" in data: |
180 # get the error info |
180 # get the error info |
181 tracebackLines = data["traceback"].splitlines() |
181 tracebackLines = data["traceback"].splitlines() |
182 # find the last entry matching the pattern |
182 # find the last entry matching the pattern |
184 fmatch = re.search(r'File "(.*?)", line (\d*?),.*', |
184 fmatch = re.search(r'File "(.*?)", line (\d*?),.*', |
185 tracebackLines[index]) |
185 tracebackLines[index]) |
186 if fmatch: |
186 if fmatch: |
187 break |
187 break |
188 if fmatch: |
188 if fmatch: |
189 fn, ln = fmatch.group(1, 2) |
189 filename = fmatch.group(1) |
|
190 lineno = int(fmatch.group(2)) |
190 |
191 |
191 if "shortmsg" in data: |
192 if "shortmsg" in data: |
192 message = data["shortmsg"] |
193 message = data["shortmsg"] |
193 elif tracebackLines: |
194 elif tracebackLines: |
194 message = tracebackLines[-1].split(":", 1)[1].strip() |
195 message = tracebackLines[-1].split(":", 1)[1].strip() |