Kaydet (Commit) 44c52617 authored tarafından Brett Cannon's avatar Brett Cannon

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.
üst dfb2a8a7
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment