Skip to content

Commit 618f4ec

Browse files
[3.15] improve json test coverage (GH-154123) (GH-154134)
Add test that covers the except block on line 106 of decoder.py (cherry picked from commit ee1e48e) Co-authored-by: David <slavicek.david29@gmail.com>
1 parent fbac0fb commit 618f4ec

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Lib/test/test_json/test_decode.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ def test_negative_index(self):
149149
d = self.json.JSONDecoder()
150150
self.assertRaises(ValueError, d.raw_decode, 'a'*42, -50000)
151151

152+
def test_unterminated_string(self):
153+
d = self.json.JSONDecoder()
154+
self.assertRaises(self.JSONDecodeError, d.raw_decode, '"\\')
155+
152156
def test_limit_int(self):
153157
maxdigits = 5000
154158
with support.adjust_int_max_str_digits(maxdigits):

0 commit comments

Comments
 (0)