diff options
Diffstat (limited to 'Lib/test/test_bytes.py')
-rw-r--r-- | Lib/test/test_bytes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index a3ea40a..992f3d2 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -169,13 +169,13 @@ class BaseBytesTest(unittest.TestCase): self.assertEqual(b[start:stop:step], self.type2test(L[start:stop:step])) def test_encoding(self): - sample = "Hello world\n\u1234\u5678\u9abc\udef0" + sample = "Hello world\n\u1234\u5678\u9abc" for enc in ("utf8", "utf16"): b = self.type2test(sample, enc) self.assertEqual(b, self.type2test(sample.encode(enc))) self.assertRaises(UnicodeEncodeError, self.type2test, sample, "latin1") b = self.type2test(sample, "latin1", "ignore") - self.assertEqual(b, self.type2test(sample[:-4], "utf-8")) + self.assertEqual(b, self.type2test(sample[:-3], "utf-8")) def test_decode(self): sample = "Hello world\n\u1234\u5678\u9abc\def0\def0" |