Skip to content

Commit

Permalink
test: remove alt.value from example-based tests
Browse files Browse the repository at this point in the history
These are intended to show the desired solution for an example.
Therefore they should use the most concise syntax
  • Loading branch information
dangotbanned committed Jul 8, 2024
1 parent 5e64fcb commit a3531fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/vegalite/v5/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit a3531fb

Please sign in to comment.