[Python-checkins] r82843 - python/branches/py3k/Lib/test/test_struct.py

mark.dickinson python-checkins at python.org
Mon Jul 12 22:03:24 CEST 2010


Author: mark.dickinson
Date: Mon Jul 12 22:03:24 2010
New Revision: 82843

Log:
Yield more information on failure in test_struct boolean test.

Modified:
   python/branches/py3k/Lib/test/test_struct.py

Modified: python/branches/py3k/Lib/test/test_struct.py
==============================================================================
--- python/branches/py3k/Lib/test/test_struct.py	(original)
+++ python/branches/py3k/Lib/test/test_struct.py	Mon Jul 12 22:03:24 2010
@@ -512,8 +512,13 @@
                 self.assertFalse(prefix, msg='encoded bool is not one byte: %r'
                                              %packed)
 
-            self.assertRaises(IOError, struct.pack, prefix + '?',
-                              ExplodingBool())
+            try:
+                struct.pack(prefix + '?', ExplodingBool())
+            except IOError:
+                pass
+            else:
+                self.fail("Expected IOError: struct.pack(%r, "
+                          "ExplodingBool())" % (prefix + '?'))
 
         for c in [b'\x01', b'\x7f', b'\xff', b'\x0f', b'\xf0']:
             self.assertTrue(struct.unpack('>?', c)[0])


More information about the Python-checkins mailing list