summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-08-17 20:24:18 (GMT)
committerGuido van Rossum <guido@python.org>2006-08-17 20:24:18 (GMT)
commitbf12cdbb2880eb402f65ce8d1db09caa84c6b801 (patch)
tree47ed0e14f7243d2431abe12a352b3cce04a779f5 /Lib/test/test_traceback.py
parent3b271054d7b2300d94f7f1bd3cb48d513d371c70 (diff)
downloadcpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.zip
cpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.tar.gz
cpython-bf12cdbb2880eb402f65ce8d1db09caa84c6b801.tar.bz2
Quite a few fixes to make the library and test suite more robust when
cPickle cannot be imported. This was necessary because my last mass checkin broke cPickle and I don't feel like debugging it right now; but it seems a good idea in general not to require cPickle when pickle.py is also there. A few unrelated fixes for issues while debigging various test failures. setup.py: disable building of cPickle until I've fixed it Objects/... genobject.c: disallow raising string exceptions Lib/... Cookie.py: fix doctest not to fail if cPickle is missing ctypes/macholib/dyld.py: fix relative imports sqlite3/__init__.py: fix relative import xml/dom/__init__.py: fix relative import Lib/test/... regrtest.py: reduce list of skipped items on darwin test_generators.py: don't test string exceptions; test throw() errors test_traceback.py: don't test string exceptions pickletester.py: don't fail if cPickle is missing test_datetime.py: don't fail if cPickle is missing test_descr.py: don't fail if cPickle is missing (still some other failures) test_exceptions.py: don't fail if cPickle is missing test_re.py: don't fail if cPickle is missing test_array.py: use pickle, not cPickle test_bool.py: don't fail if cPickle is missing test_deque.py: use pickle, not cPickle test_logging.py: use pickle, not cPickle
Diffstat (limited to 'Lib/test/test_traceback.py')
-rw-r--r--Lib/test/test_traceback.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index b3c5a50..6f9e464 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -111,35 +111,6 @@ def test():
lst = traceback.format_exception_only(e.__class__, e)
self.assertEqual(lst, ['KeyboardInterrupt\n'])
- # String exceptions are deprecated, but legal. The quirky form with
- # separate "type" and "value" tends to break things, because
- # not isinstance(value, type)
- # and a string cannot be the first argument to issubclass.
- #
- # Note that sys.last_type and sys.last_value do not get set if an
- # exception is caught, so we sort of cheat and just emulate them.
- #
- # test_string_exception1 is equivalent to
- #
- # >>> raise "String Exception"
- #
- # test_string_exception2 is equivalent to
- #
- # >>> raise "String Exception", "String Value"
- #
- def test_string_exception1(self):
- str_type = "String Exception"
- err = traceback.format_exception_only(str_type, None)
- self.assertEqual(len(err), 1)
- self.assertEqual(err[0], str_type + '\n')
-
- def test_string_exception2(self):
- str_type = "String Exception"
- str_value = "String Value"
- err = traceback.format_exception_only(str_type, str_value)
- self.assertEqual(len(err), 1)
- self.assertEqual(err[0], str_type + ': ' + str_value + '\n')
-
def test_format_exception_only_bad__str__(self):
class X(Exception):
def __str__(self):