Commit 04edd680 authored by Fred Drake's avatar Fred Drake

Don't raise a string exception; those trigger deprecation warnings in

Python 2.3.
parent 47c6f6a5
......@@ -13,8 +13,8 @@
"""Document Template Tests
"""
__rcs_id__='$Id: testDTML.py,v 1.14 2002/08/14 22:29:53 mj Exp $'
__version__='$Revision: 1.14 $'[11:-2]
__rcs_id__='$Id: testDTML.py,v 1.15 2003/07/09 15:12:07 fdrake Exp $'
__version__='$Revision: 1.15 $'[11:-2]
import sys, os
import unittest
......@@ -43,6 +43,9 @@ class D:
def d(**kw): return kw
class PukeError(Exception):
"""Exception raised in test code."""
class DTMLTests (unittest.TestCase):
doc_class = HTML
......@@ -353,7 +356,7 @@ foo bar
puke__roles__ = None # Public
def puke(self):
raise 'Puke', 'raaalf'
raise PukeError('raaalf')
html=self.doc_class(
"""
......@@ -366,7 +369,7 @@ foo bar
""")
try:
html(spam=foo())
except 'Puke':
except PukeError:
# Passed the test.
pass
else:
......
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