diff --git a/tests/vegalite/v5/test_api.py b/tests/vegalite/v5/test_api.py index 5ca60e1f8..1e28e39b8 100644 --- a/tests/vegalite/v5/test_api.py +++ b/tests/vegalite/v5/test_api.py @@ -548,7 +548,7 @@ def test_when_labels_position_based_on_condition() -> None: expr=alt.expr.if_(param_width_lt_200, "red", "black") ) when = ( - alt.when(param_width_lt_200) + alt.when(param_width_lt_200.expr) .then(alt.value("red")) .otherwise(alt.value("black")) ) @@ -564,7 +564,11 @@ def test_when_labels_position_based_on_condition() -> None: test = cond["test"] assert not isinstance(test, alt.PredicateComposition) param_color_py_when = alt.param(expr=alt.expr.if_(test, cond["value"], otherwise)) - assert param_color_py_expr.expr == param_color_py_when.expr + lhs_param = param_color_py_expr.param + rhs_param = param_color_py_when.param + assert isinstance(lhs_param, alt.VariableParameter) + assert isinstance(rhs_param, alt.VariableParameter) + assert repr(lhs_param.expr) == repr(rhs_param.expr) chart = ( alt.Chart(df)