44
55# 3rd party
66import pytest
7+ from coincidence .selectors import max_version , min_version
78from domdf_python_tools .compat import PYPY
89
910# this package
@@ -162,11 +163,18 @@ def test_truncated_input(data: str, msg: str, idx: int):
162163 ('{"spam":[}' , unexpected_right_brace , 9 ),
163164 ("[42:" , unexpected_colon , 3 ),
164165 ('[42 "spam"' , "Unexpected '\" ' when decoding array" if PYPY else "Expecting ',' delimiter" , 4 ),
165- ("[42,]" , "Unexpected ']'" if PYPY else "Expecting value" , 4 ),
166+ pytest .param ("[42,]" , "Illegal trailing comma before end of array" , 3 , marks = min_version ((3 , 13 ))),
167+ pytest .param (
168+ "[42,]" , "Unexpected ']'" if PYPY else "Expecting value" , 4 , marks = max_version ((3 , 12 ))
169+ ),
166170 ('{"spam":[42}' , "Unexpected '}' when decoding array" if PYPY else "Expecting ',' delimiter" , 11 ),
167171 ('["]' , "Unterminated string starting at" , 1 ),
168172 ('["spam":' , unexpected_colon , 7 ),
169- ('["spam",]' , "Unexpected ']'" if PYPY else "Expecting value" , 8 ),
173+ pytest .param (
174+ '["spam",]' , "Illegal trailing comma before end of array" , 7 , marks = min_version ((3 , 13 ))
175+ ),
176+ pytest .
177+ param ('["spam",]' , "Unexpected ']'" if PYPY else "Expecting value" , 8 , marks = max_version ((3 , 12 ))),
170178 ("{:" , property_name_string , 1 ),
171179 ("{," , property_name_string , 1 ),
172180 ("{42" , property_name_string , 1 ),
@@ -182,7 +190,13 @@ def test_truncated_input(data: str, msg: str, idx: int):
182190 11
183191 ),
184192 ('[{"spam":42]' , "Unexpected ']' when decoding object" if PYPY else "Expecting ',' delimiter" , 11 ),
185- ('{"spam":42,}' , property_name_string , 11 ),
193+ pytest .param (
194+ '{"spam":42,}' ,
195+ "Illegal trailing comma before end of object" ,
196+ 10 ,
197+ marks = min_version ((3 , 13 ))
198+ ),
199+ pytest .param ('{"spam":42,}' , property_name_string , 11 , marks = max_version ((3 , 12 ))),
186200 ]
187201 )
188202def test_unexpected_data (data : str , msg : str , idx : int ):
0 commit comments