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