[Python-checkins] cpython (2.7): add a test for an assertion with tuple msg

benjamin.peterson python-checkins at python.org
Thu Oct 27 14:24:53 CEST 2011


http://hg.python.org/cpython/rev/67bfadf4f954
changeset:   73142:67bfadf4f954
branch:      2.7
parent:      73135:e0499b2b28aa
user:        Benjamin Peterson <benjamin at python.org>
date:        Thu Oct 27 08:20:01 2011 -0400
summary:
  add a test for an assertion with tuple msg

files:
  Lib/test/test_exceptions.py |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -473,6 +473,12 @@
         with self.assertRaises(TypeError):
             raise MyException
 
+    def test_assert_with_tuple_arg(self):
+        try:
+            assert False, (3,)
+        except AssertionError as e:
+            self.assertEqual(str(e), "(3,)")
+
 
 # Helper class used by TestSameStrAndUnicodeMsg
 class ExcWithOverriddenStr(Exception):

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list