Skip to content

Commit

Permalink
test: Update validation errors to use non-iterable element type
Browse files Browse the repository at this point in the history
Previously `list[set[str]]`
  • Loading branch information
dangotbanned committed Jul 24, 2024
1 parent 1ff970c commit 1f3dfd3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/utils/test_schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,23 +524,23 @@ def chart_error_example__wrong_tooltip_type_in_faceted_chart():
return (
alt.Chart(pd.DataFrame({"a": [1]}))
.mark_point()
.encode(tooltip=[{"wrong"}])
.encode(tooltip=[{5000}])
.facet()
)


def chart_error_example__wrong_tooltip_type_in_layered_chart():
# Error: Wrong data type to pass to tooltip
return alt.layer(
alt.Chart().mark_point().encode(tooltip=[{"wrong"}]),
alt.Chart().mark_point().encode(tooltip=[{5000}]),
)


def chart_error_example__two_errors_in_layered_chart():
# Error 1: Wrong data type to pass to tooltip
# Error 2: `Color` has no parameter named 'invalidArgument'
return alt.layer(
alt.Chart().mark_point().encode(tooltip=[{"wrong"}]),
alt.Chart().mark_point().encode(tooltip=[{5000}]),
alt.Chart().mark_line().encode(alt.Color(invalidArgument="unknown")),
)

Expand Down Expand Up @@ -656,21 +656,21 @@ def chart_error_example__four_errors():
(
chart_error_example__wrong_tooltip_type_in_faceted_chart,
inspect.cleandoc(
r"""'{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$"""
r"""'\[5000\]' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$"""
),
),
(
chart_error_example__wrong_tooltip_type_in_layered_chart,
inspect.cleandoc(
r"""'{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$"""
r"""'\[5000\]' is an invalid value for `field`. Valid values are of type 'string' or 'object'.$"""
),
),
(
chart_error_example__two_errors_in_layered_chart,
inspect.cleandoc(
r"""Multiple errors were found.
Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 1: '\[5000\]' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 2: `Color` has no parameter named 'invalidArgument'
Expand All @@ -687,7 +687,7 @@ def chart_error_example__four_errors():
inspect.cleandoc(
r"""Multiple errors were found.
Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 1: '\[5000\]' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 2: '4' is an invalid value for `bandPosition`. Valid values are of type 'number'.$"""
),
Expand All @@ -697,7 +697,7 @@ def chart_error_example__four_errors():
inspect.cleandoc(
r"""Multiple errors were found.
Error 1: '{'wrong'}' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 1: '\[5000\]' is an invalid value for `field`. Valid values are of type 'string' or 'object'.
Error 2: `Color` has no parameter named 'invalidArgument'
Expand Down

0 comments on commit 1f3dfd3

Please sign in to comment.