Tweak the fix for test_traceback since the fix for it to run on its own broke
it under regrtest. 'traceback' likes to strip out the module name if it is __main__ or __builtin__ but not in other cases.
This commit is contained in:
parent
dfb2a8a7c1
commit
44c526174d
|
@ -118,7 +118,11 @@ def test():
|
|||
err = traceback.format_exception_only(X, X())
|
||||
self.assertEqual(len(err), 1)
|
||||
str_value = '<unprintable %s object>' % X.__name__
|
||||
self.assertEqual(err[0], "%s: %s\n" % ( X.__name__, str_value))
|
||||
if X.__module__ in ('__main__', '__builtin__'):
|
||||
str_name = X.__name__
|
||||
else:
|
||||
str_name = '.'.join([X.__module__, X.__name__])
|
||||
self.assertEqual(err[0], "%s: %s\n" % (str_name, str_value))
|
||||
|
||||
def test_without_exception(self):
|
||||
err = traceback.format_exception_only(None, None)
|
||||
|
|
Loading…
Reference in New Issue