summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_exceptions.py9
-rw-r--r--Lib/test/test_pep352.py3
2 files changed, 10 insertions, 2 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index af07aa8..27d88a0 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -304,6 +304,15 @@ class ExceptionTests(unittest.TestCase):
return -1
self.assertRaises(RuntimeError, g)
+ def testUnicodeStrUsage(self):
+ # Make sure both instances and classes have a str and unicode
+ # representation.
+ self.failUnless(str(Exception))
+ self.failUnless(unicode(Exception))
+ self.failUnless(str(Exception('a')))
+ self.failUnless(unicode(Exception(u'a')))
+
+
def test_main():
run_unittest(ExceptionTests)
diff --git a/Lib/test/test_pep352.py b/Lib/test/test_pep352.py
index 251e0be..b2322b0 100644
--- a/Lib/test/test_pep352.py
+++ b/Lib/test/test_pep352.py
@@ -15,8 +15,7 @@ class ExceptionClassTests(unittest.TestCase):
self.failUnless(issubclass(Exception, object))
def verify_instance_interface(self, ins):
- for attr in ("args", "message", "__str__", "__unicode__", "__repr__",
- "__getitem__"):
+ for attr in ("args", "message", "__str__", "__repr__", "__getitem__"):
self.failUnless(hasattr(ins, attr), "%s missing %s attribute" %
(ins.__class__.__name__, attr))