[Python-checkins] r82747 - python/branches/release27-maint/Lib/test/test_struct.py

benjamin.peterson python-checkins at python.org
Fri Jul 9 20:15:28 CEST 2010


Author: benjamin.peterson
Date: Fri Jul  9 20:15:28 2010
New Revision: 82747

Log:
this makes checking for warnings less error prone

Modified:
   python/branches/release27-maint/Lib/test/test_struct.py

Modified: python/branches/release27-maint/Lib/test/test_struct.py
==============================================================================
--- python/branches/release27-maint/Lib/test/test_struct.py	(original)
+++ python/branches/release27-maint/Lib/test/test_struct.py	Fri Jul  9 20:15:28 2010
@@ -317,9 +317,8 @@
                                   randrange)
                 with check_warnings(("integer argument expected, "
                                      "got non-integer", DeprecationWarning)):
-                    self.assertRaises((TypeError, struct.error),
-                                      struct.pack, self.format,
-                                      3+42j)
+                    with self.assertRaises((TypeError, struct.error)):
+                        struct.pack(self.format, 3+42j)
 
                 # an attempt to convert a non-integer (with an
                 # implicit conversion via __int__) should succeed,


More information about the Python-checkins mailing list