Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6907)

Delta Between Two Patch Sets: Lib/test/test_json/test_scanstring.py

Issue 19361: Specialize exceptions thrown by JSON parser
Left Patch Set: Created 5 years ago
Right Patch Set: Created 4 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Lib/test/test_json/test_fail.py ('k') | Modules/_json.c » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 import sys 1 import sys
2 from test.test_json import PyTest, CTest 2 from test.test_json import PyTest, CTest
3 3
4 4
5 class TestScanstring: 5 class TestScanstring:
6 def test_scanstring(self): 6 def test_scanstring(self):
7 scanstring = self.json.decoder.scanstring 7 scanstring = self.json.decoder.scanstring
8 self.assertEqual( 8 self.assertEqual(
9 scanstring('"z\U0001d120x"', 1, True), 9 scanstring('"z\U0001d120x"', 1, True),
10 ('z\U0001d120x', 5)) 10 ('z\U0001d120x', 5))
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 with self.assertRaises(self.JSONDecodeError, msg=s): 132 with self.assertRaises(self.JSONDecodeError, msg=s):
133 scanstring(s, 1, True) 133 scanstring(s, 1, True)
134 134
135 def test_overflow(self): 135 def test_overflow(self):
136 with self.assertRaises(OverflowError): 136 with self.assertRaises(OverflowError):
137 self.json.decoder.scanstring(b"xxx", sys.maxsize+1) 137 self.json.decoder.scanstring(b"xxx", sys.maxsize+1)
138 138
139 139
140 class TestPyScanstring(TestScanstring, PyTest): pass 140 class TestPyScanstring(TestScanstring, PyTest): pass
141 class TestCScanstring(TestScanstring, CTest): pass 141 class TestCScanstring(TestScanstring, CTest): pass
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+