This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients Julian, Yaroslav.Halchenko, abingham, bfroehle, borja.ruiz, brian.curtin, chris.jerdonek, eric.araujo, eric.snow, exarkun, ezio.melotti, fperez, hpk, kynan, michael.foord, nchauvat, ncoghlan, pitrou, r.david.murray, santoso.wijaya, serhiy.storchaka, spiv
Date 2013-01-18.21:22:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358544173.08.0.752844876903.issue16997@psf.upfronthosting.co.za>
In-reply-to
Content
Since I was asked on IRC, an example of converting an existing test. It's quite trivial really:

diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -630,9 +630,10 @@ class UTF16BETest(ReadTest, unittest.Tes
             (b'\xdc\x00\x00A', '\ufffdA'),
         ]
         for raw, expected in tests:
-            self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode,
-                              raw, 'strict', True)
-            self.assertEqual(raw.decode('utf-16be', 'replace'), expected)
+            with self.subTest(raw=raw, expected=expected):
+                self.assertRaises(UnicodeDecodeError, codecs.utf_16_be_decode,
+                                  raw, 'strict', True)
+                self.assertEqual(raw.decode('utf-16be', 'replace'), expected)
 
     def test_nonbmp(self):
         self.assertEqual("\U00010203".encode(self.encoding),
History
Date User Action Args
2013-01-18 21:22:53pitrousetrecipients: + pitrou, spiv, exarkun, ncoghlan, ezio.melotti, eric.araujo, r.david.murray, michael.foord, brian.curtin, hpk, fperez, chris.jerdonek, Yaroslav.Halchenko, santoso.wijaya, nchauvat, kynan, Julian, abingham, eric.snow, serhiy.storchaka, borja.ruiz, bfroehle
2013-01-18 21:22:53pitrousetmessageid: <1358544173.08.0.752844876903.issue16997@psf.upfronthosting.co.za>
2013-01-18 21:22:53pitroulinkissue16997 messages
2013-01-18 21:22:52pitroucreate