Message180226
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), |
|
Date |
User |
Action |
Args |
2013-01-18 21:22:53 | pitrou | set | recipients:
+ 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:53 | pitrou | set | messageid: <1358544173.08.0.752844876903.issue16997@psf.upfronthosting.co.za> |
2013-01-18 21:22:53 | pitrou | link | issue16997 messages |
2013-01-18 21:22:52 | pitrou | create | |
|