Skip to content

Commit 08ff4a8

Browse files
committed
update error messages
1 parent 2720911 commit 08ff4a8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/test_core/test_vdom.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
import pytest
24
from fastjsonschema import JsonSchemaException
35

@@ -213,6 +215,9 @@ def test_valid_vdom(value):
213215
validate_vdom_json(value)
214216

215217

218+
@pytest.mark.skipif(
219+
sys.version_info < (3, 10), reason="error messages are different in Python<3.10"
220+
)
216221
@pytest.mark.parametrize(
217222
"value, error_message_pattern",
218223
[
@@ -230,23 +235,23 @@ def test_valid_vdom(value):
230235
),
231236
(
232237
{"tagName": "tag", "children": None},
233-
r"data must be array",
238+
r"data\.children must be array",
234239
),
235240
(
236241
{"tagName": "tag", "children": [None]},
237-
r"data must be object or string",
242+
r"data\.children\[{data_x}\] must be object or string",
238243
),
239244
(
240245
{"tagName": "tag", "children": [{"tagName": None}]},
241-
r"data\.tagName must be string",
246+
r"data\.children\[{data_x}\]\.tagName must be string",
242247
),
243248
(
244249
{"tagName": "tag", "attributes": None},
245-
r"data.attributes must be object",
250+
r"data\.attributes must be object",
246251
),
247252
(
248253
{"tagName": "tag", "eventHandlers": None},
249-
r"data must be object",
254+
r"data\.eventHandlers must be object",
250255
),
251256
(
252257
{"tagName": "tag", "eventHandlers": {"onEvent": None}},

0 commit comments

Comments
 (0)