def test_traceback_string(self): try: raise ValueError(3) except ValueError: ts = tb.traceback_string() # Don't want to be too strict with the checks. if "('test_tb.py test_traceback_string|22'" not in ts: self.fail('No line found: %r' % (ts,)) if 'ValueError' not in ts: self.fail('No value error: %r' % (ts,)) if "'3'" not in ts: self.fail('Exception value not found: %r' % (ts,)) if '[test_tb.py test_traceback_string|22]' not in ts: self.fail('Stack string not found: %r' % (ts,))
def test_traceback_string(self): try: raise ValueError(3) except ValueError: ts = tb.traceback_string() # Don't want to be too strict with the checks. if "('test_tb.py test_traceback_string|22'" not in ts: self.fail('No line found: %r' % (ts, )) if 'ValueError' not in ts: self.fail('No value error: %r' % (ts, )) if "'3'" not in ts: self.fail('Exception value not found: %r' % (ts, )) if '[test_tb.py test_traceback_string|22]' not in ts: self.fail('Stack string not found: %r' % (ts, ))
def exception_notifier(): exc_str = tb.traceback_string() coro.default_exception_notifier() exc_str_list.append(exc_str)