@@ -145,12 +145,12 @@ def __test_invalid_input(data: str, msg: str, idx: int) -> None:
145145 (
146146 '{"spam":42' ,
147147 "Unterminated object starting at" if PYPY else "Expecting ',' delimiter" ,
148- 1 if PYPY else 10
148+ 1 if PYPY else 10 ,
149149 ),
150150 ('{"spam":42,' , property_name_string , 11 ),
151151 ('"' , "Unterminated string starting at" , 0 ),
152152 ('"spam' , "Unterminated string starting at" , 0 ),
153- ]
153+ ],
154154 )
155155def test_truncated_input (data : str , msg : str , idx : int ):
156156 __test_invalid_input (data , msg , idx )
@@ -165,13 +165,19 @@ def test_truncated_input(data: str, msg: str, idx: int):
165165 ('[42 "spam"' , "Unexpected '\" ' when decoding array" if PYPY else "Expecting ',' delimiter" , 4 ),
166166 pytest .param ("[42,]" , "Illegal trailing comma before end of array" , 3 , marks = min_version ((3 , 13 ))),
167167 pytest .param (
168- "[42,]" , "Unexpected ']'" if PYPY else "Expecting value" , 4 , marks = max_version ((3 , 12 ))
168+ "[42,]" ,
169+ "Unexpected ']'" if PYPY else "Expecting value" ,
170+ 4 ,
171+ marks = max_version ((3 , 12 )),
169172 ),
170173 ('{"spam":[42}' , "Unexpected '}' when decoding array" if PYPY else "Expecting ',' delimiter" , 11 ),
171174 ('["]' , "Unterminated string starting at" , 1 ),
172175 ('["spam":' , unexpected_colon , 7 ),
173176 pytest .param (
174- '["spam",]' , "Illegal trailing comma before end of array" , 7 , marks = min_version ((3 , 13 ))
177+ '["spam",]' ,
178+ "Illegal trailing comma before end of array" ,
179+ 7 ,
180+ marks = min_version ((3 , 13 )),
175181 ),
176182 pytest .
177183 param ('["spam",]' , "Unexpected ']'" if PYPY else "Expecting value" , 8 , marks = max_version ((3 , 12 ))),
@@ -187,17 +193,17 @@ def test_truncated_input(data: str, msg: str, idx: int):
187193 (
188194 '{"spam":42 "ham"' ,
189195 "Unexpected '\" ' when decoding object" if PYPY else "Expecting ',' delimiter" ,
190- 11
196+ 11 ,
191197 ),
192198 ('[{"spam":42]' , "Unexpected ']' when decoding object" if PYPY else "Expecting ',' delimiter" , 11 ),
193199 pytest .param (
194200 '{"spam":42,}' ,
195201 "Illegal trailing comma before end of object" ,
196202 10 ,
197- marks = min_version ((3 , 13 ))
203+ marks = min_version ((3 , 13 )),
198204 ),
199205 pytest .param ('{"spam":42,}' , property_name_string , 11 , marks = max_version ((3 , 12 ))),
200- ]
206+ ],
201207 )
202208def test_unexpected_data (data : str , msg : str , idx : int ):
203209 __test_invalid_input (data , msg , idx )
@@ -212,19 +218,20 @@ def test_unexpected_data(data: str, msg: str, idx: int):
212218 ("{},{}" , "Extra data" , 2 ),
213219 ('42,"spam"' , "Extra data" , 2 ),
214220 ('"spam",42' , "Extra data" , 6 ),
215- ]
221+ ],
216222 )
217223def test_extra_data (data : str , msg : str , idx : int ):
218224 __test_invalid_input (data , msg , idx )
219225
220226
221227@pytest .mark .parametrize (
222- "data, line, col, idx" , [
228+ "data, line, col, idx" ,
229+ [
223230 ('!' , 1 , 1 , 0 ),
224231 (" !" , 1 , 2 , 1 ),
225232 ("\n !" , 2 , 1 , 1 ),
226233 ("\n \n \n !" , 4 , 6 , 10 ),
227- ]
234+ ],
228235 )
229236def test_linecol (data : str , line : int , col : int , idx : int ):
230237
0 commit comments