Truncates usercode tb at the first unittest frame. If the first frame of the traceback is in user code, the prefix up to the first unittest frame is returned. If the first frame is already in the unittest module, the traceback is not modified.
(self, tb)
| 239 | return '__unittest' in tb.tb_frame.f_globals |
| 240 | |
| 241 | def _remove_unittest_tb_frames(self, tb): |
| 242 | '''Truncates usercode tb at the first unittest frame. |
| 243 | |
| 244 | If the first frame of the traceback is in user code, |
| 245 | the prefix up to the first unittest frame is returned. |
| 246 | If the first frame is already in the unittest module, |
| 247 | the traceback is not modified. |
| 248 | ''' |
| 249 | prev = None |
| 250 | while tb and not self._is_relevant_tb_level(tb): |
| 251 | prev = tb |
| 252 | tb = tb.tb_next |
| 253 | if prev is not None: |
| 254 | prev.tb_next = None |
| 255 | |
| 256 | def __repr__(self): |
| 257 | return ("<%s run=%i errors=%i failures=%i>" % |
no test coverage detected