From: David Date: Sun, 19 Jul 2026 13:19:00 +0000 (+0200) Subject: improve json test coverage (GH-154123) X-Git-Url: http://git.ipfire.org/index.cgi?a=commitdiff_plain;h=ee1e48ebd8194cd5984714021c4df85dbb93c6df;p=thirdparty%2FPython%2Fcpython.git improve json test coverage (GH-154123) Add test that covers the except block on line 106 of decoder.py --- diff --git a/Lib/test/test_json/test_decode.py b/Lib/test/test_json/test_decode.py index 6d05ef8f8eb0..33aeefa92f28 100644 --- a/Lib/test/test_json/test_decode.py +++ b/Lib/test/test_json/test_decode.py @@ -149,6 +149,10 @@ class TestDecode: d = self.json.JSONDecoder() self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000) + def test_unterminated_string(self): + d = self.json.JSONDecoder() + self.assertRaises(self.JSONDecodeError, d.raw_decode, '"\\') + def test_limit_int(self): maxdigits = 5000 with support.adjust_int_max_str_digits(maxdigits):