diff options
Diffstat (limited to 'Lib/json/tests/test_unicode.py')
-rw-r--r-- | Lib/json/tests/test_unicode.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/json/tests/test_unicode.py b/Lib/json/tests/test_unicode.py index 31cf389..e90f158 100644 --- a/Lib/json/tests/test_unicode.py +++ b/Lib/json/tests/test_unicode.py @@ -80,6 +80,10 @@ class TestUnicode(object): # Issue 10038. self.assertEqual(type(self.loads('"foo"')), unicode) + def test_bad_encoding(self): + self.assertRaises(UnicodeEncodeError, self.loads, '"a"', u"rat\xe9") + self.assertRaises(TypeError, self.loads, '"a"', 1) + class TestPyUnicode(TestUnicode, PyTest): pass class TestCUnicode(TestUnicode, CTest): pass |