]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] improve json test coverage (GH-154123) (GH-154134)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 19 Jul 2026 15:16:37 +0000 (17:16 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 15:16:37 +0000 (17:16 +0200)
Add test that covers the except block on line 106 of decoder.py
(cherry picked from commit ee1e48ebd8194cd5984714021c4df85dbb93c6df)

Co-authored-by: David <slavicek.david29@gmail.com>
Lib/test/test_json/test_decode.py

index 6d05ef8f8eb09181014737f56782fd94be90946f..33aeefa92f282ae71738fa1ef829bb7cfecd583e 100644 (file)
@@ -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):