Skip to content

Commit a225878

Browse files
committed
Change tests to expect html as the default display_style
1 parent be83990 commit a225878

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

xarray/tests/test_options.py

+12-10
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ def test_nested_options():
6868

6969

7070
def test_display_style():
71-
original = "text"
71+
original = "html"
7272
assert OPTIONS["display_style"] == original
7373
with pytest.raises(ValueError):
7474
xarray.set_options(display_style="invalid_str")
75-
with xarray.set_options(display_style="html"):
76-
assert OPTIONS["display_style"] == "html"
75+
with xarray.set_options(display_style="text"):
76+
assert OPTIONS["display_style"] == "text"
7777
assert OPTIONS["display_style"] == original
7878

7979

@@ -177,10 +177,11 @@ def test_merge_attr_retention(self):
177177

178178
def test_display_style_text(self):
179179
ds = create_test_dataset_attrs()
180-
text = ds._repr_html_()
181-
assert text.startswith("<pre>")
182-
assert "&#x27;nested&#x27;" in text
183-
assert "&lt;xarray.Dataset&gt;" in text
180+
with xarray.set_options(display_style="text"):
181+
text = ds._repr_html_()
182+
assert text.startswith("<pre>")
183+
assert "&#x27;nested&#x27;" in text
184+
assert "&lt;xarray.Dataset&gt;" in text
184185

185186
def test_display_style_html(self):
186187
ds = create_test_dataset_attrs()
@@ -191,9 +192,10 @@ def test_display_style_html(self):
191192

192193
def test_display_dataarray_style_text(self):
193194
da = create_test_dataarray_attrs()
194-
text = da._repr_html_()
195-
assert text.startswith("<pre>")
196-
assert "&lt;xarray.DataArray &#x27;var1&#x27;" in text
195+
with xarray.set_options(display_style="text"):
196+
text = da._repr_html_()
197+
assert text.startswith("<pre>")
198+
assert "&lt;xarray.DataArray &#x27;var1&#x27;" in text
197199

198200
def test_display_dataarray_style_html(self):
199201
da = create_test_dataarray_attrs()

0 commit comments

Comments
 (0)