summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-01-23 15:47:15 (GMT)
committerXiang Zhang <angwerzx@126.com>2018-01-23 15:47:15 (GMT)
commit6abbf14a876ee1e04d1493bb27025f2f0aa56430 (patch)
tree2465680191c8ef936c7d52e604c1d7b88d458f6c
parent4002d5dbf4c058bbf2462f9f5dea057956d1caff (diff)
downloadcpython-6abbf14a876ee1e04d1493bb27025f2f0aa56430.zip
cpython-6abbf14a876ee1e04d1493bb27025f2f0aa56430.tar.gz
cpython-6abbf14a876ee1e04d1493bb27025f2f0aa56430.tar.bz2
bpo-32618: Fix test_mutatingdecodehandler not testing test.mutating (GH-5269) (#5285)
It should test both test.replacing and test.mutating instead of test test.replacing twice. (cherry picked from commit 370d04d1dcca50a52d59f40aff4d11434f71df6b)
-rw-r--r--Lib/test/test_codeccallbacks.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py
index 6a3e993..0c066e6 100644
--- a/Lib/test/test_codeccallbacks.py
+++ b/Lib/test/test_codeccallbacks.py
@@ -1032,7 +1032,7 @@ class CodecCallbackTest(unittest.TestCase):
def mutating(exc):
if isinstance(exc, UnicodeDecodeError):
- exc.object[:] = b""
+ exc.object = b""
return ("\u4242", 0)
else:
raise TypeError("don't know how to handle %r" % exc)
@@ -1042,8 +1042,7 @@ class CodecCallbackTest(unittest.TestCase):
with test.support.check_warnings():
# unicode-internal has been deprecated
for (encoding, data) in baddata:
- with self.assertRaises(TypeError):
- data.decode(encoding, "test.replacing")
+ self.assertEqual(data.decode(encoding, "test.mutating"), "\u4242")
def test_fake_error_class(self):
handlers = [