1
+ import sys
2
+
1
3
import pytest
2
4
from fastjsonschema import JsonSchemaException
3
5
@@ -213,6 +215,9 @@ def test_valid_vdom(value):
213
215
validate_vdom_json (value )
214
216
215
217
218
+ @pytest .mark .skipif (
219
+ sys .version_info < (3 , 10 ), reason = "error messages are different in Python<3.10"
220
+ )
216
221
@pytest .mark .parametrize (
217
222
"value, error_message_pattern" ,
218
223
[
@@ -230,23 +235,23 @@ def test_valid_vdom(value):
230
235
),
231
236
(
232
237
{"tagName" : "tag" , "children" : None },
233
- r"data must be array" ,
238
+ r"data\.children must be array" ,
234
239
),
235
240
(
236
241
{"tagName" : "tag" , "children" : [None ]},
237
- r"data must be object or string" ,
242
+ r"data\.children\[{data_x}\] must be object or string" ,
238
243
),
239
244
(
240
245
{"tagName" : "tag" , "children" : [{"tagName" : None }]},
241
- r"data\.tagName must be string" ,
246
+ r"data\.children\[{data_x}\]\. tagName must be string" ,
242
247
),
243
248
(
244
249
{"tagName" : "tag" , "attributes" : None },
245
- r"data.attributes must be object" ,
250
+ r"data\ .attributes must be object" ,
246
251
),
247
252
(
248
253
{"tagName" : "tag" , "eventHandlers" : None },
249
- r"data must be object" ,
254
+ r"data\.eventHandlers must be object" ,
250
255
),
251
256
(
252
257
{"tagName" : "tag" , "eventHandlers" : {"onEvent" : None }},
0 commit comments