summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-02-27 00:12:43 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-02-27 00:12:43 (GMT)
commit44c526174d9296ce358ccee9652382e7ea5377f4 (patch)
treeb73f7e9b78a8ff681ebd64386a165cafdc5ddfd3 /Lib/test
parentdfb2a8a7c176b4db246a6f32bdf4a1b079bdd4eb (diff)
downloadcpython-44c526174d9296ce358ccee9652382e7ea5377f4.zip
cpython-44c526174d9296ce358ccee9652382e7ea5377f4.tar.gz
cpython-44c526174d9296ce358ccee9652382e7ea5377f4.tar.bz2
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.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_traceback.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index 51fb9e6..1b9e2f8 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -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)