[Python-checkins] CVS: python/dist/src/Lib/test test_exceptions.py,1.6,1.7
Jeremy Hylton
python-dev@python.org
Tue, 20 Jun 2000 11:53:00 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv25768
Modified Files:
test_exceptions.py
Log Message:
add minimal test of exception use. verify that each exception can be
raised, caught, and converted to a string.
Index: test_exceptions.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** test_exceptions.py 2000/05/25 23:16:34 1.6
--- test_exceptions.py 2000/06/20 18:52:57 1.7
***************
*** 7,11 ****
--- 7,23 ----
# XXX This is not really enough, each *operation* should be tested!
+ def test_raise_catch(exc):
+ try:
+ raise exc, "spam"
+ except exc, err:
+ buf = str(err)
+ try:
+ raise exc("spam")
+ except exc, err:
+ buf = str(err)
+ print buf
+
def r(thing):
+ test_raise_catch(thing)
if type(thing) == ClassType:
print thing.__name__