Skip to content

Commit

Permalink
Fix JupyterChart tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Dec 12, 2023
1 parent ae373a9 commit 11a9056
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/test_jupyter_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def test_chart_with_no_interactivity(transformer):
widget = alt.JupyterChart(chart)

if transformer == "vegafusion":
# With the "vegafusion" transformer, the spec is not computed until the front-end
# sets the local_tz. Assign this property manually to simulate this.
widget.local_tz = "UTC"
assert widget.spec == chart.to_dict(format="vega")
else:
assert widget.spec == chart.to_dict()
Expand Down Expand Up @@ -59,6 +62,7 @@ def test_interval_selection_example(transformer):
widget = alt.JupyterChart(chart)

if transformer == "vegafusion":
widget.local_tz = "UTC"
assert widget.spec == chart.to_dict(format="vega")
else:
assert widget.spec == chart.to_dict()
Expand Down Expand Up @@ -126,6 +130,7 @@ def test_index_selection_example(transformer):
widget = alt.JupyterChart(chart)

if transformer == "vegafusion":
widget.local_tz = "UTC"
assert widget.spec == chart.to_dict(format="vega")
else:
assert widget.spec == chart.to_dict()
Expand Down Expand Up @@ -185,6 +190,7 @@ def test_point_selection(transformer):
widget = alt.JupyterChart(chart)

if transformer == "vegafusion":
widget.local_tz = "UTC"
assert widget.spec == chart.to_dict(format="vega")
else:
assert widget.spec == chart.to_dict()
Expand Down

0 comments on commit 11a9056

Please sign in to comment.