From a3531fb676096b381c16010fcf43e3baac2ad9fc Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:29:31 +0100 Subject: [PATCH] test: remove `alt.value` from example-based tests These are intended to show the desired solution for an example. Therefore they should use the most concise syntax --- tests/vegalite/v5/test_api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vegalite/v5/test_api.py b/tests/vegalite/v5/test_api.py index d3e02bea7..b32782c14 100644 --- a/tests/vegalite/v5/test_api.py +++ b/tests/vegalite/v5/test_api.py @@ -452,7 +452,7 @@ def test_when_then_when_then_otherwise() -> None: with pytest.raises(TypeError, match="set"): when_then_when_then.otherwise({"five", "six"}) # type: ignore - actual_stroke = when_then_when_then.otherwise(alt.value(0)) + actual_stroke = when_then_when_then.otherwise(0) expected_stroke = { "condition": [ {"param": "select", "empty": False, "value": 2}, @@ -498,7 +498,7 @@ def test_when_labels_position_based_on_condition() -> None: param_color_py_expr = alt.param( expr=alt.expr.if_(param_width_lt_200, "red", "black") ) - when = alt.when(param_width_lt_200).then(alt.value("red")).otherwise("black") + when = alt.when(param_width_lt_200).then("red").otherwise("black") cond = when["condition"][0] otherwise = when["value"] param_color_py_when = alt.param(