Skip to content

Commit

Permalink
run the test, avoid the cache-related bits
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed Aug 2, 2023
1 parent c187d90 commit 88302dc
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/yt_napari/_tests/test_widget_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_widget_reader_add_selections(make_napari_viewer, yt_ugrid_ds_fn):
assert sel.selection_type == "Slice"


@pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
#@pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
def test_widget_reader(make_napari_viewer, yt_ugrid_ds_fn, caplog, qtbot):

# make_napari_viewer is a pytest fixture. It takes any keyword arguments
Expand Down Expand Up @@ -63,21 +63,21 @@ def rebuild_data(final_shape, data):
r._post_load_function = rebuild
r.load_data()

mgui_region.fields.field_name.value = "temperature"
mgui_region.left_edge.value.value = (0.4, 0.4, 0.4)
mgui_region.right_edge.value.value = (0.6, 0.6, 0.6)
r.load_data()
# should have read from cache, check the log:
assert yt_ugrid_ds_fn in caplog.text
# the viewer should now have two images
assert len(viewer.layers) == 2

temp_layer = viewer.layers[1]
assert temp_layer.metadata["_yt_napari_layer"] is True

r.clear_cache()
assert len(dataset_cache.available) == 0

_ = r.yt_scene
yt_scene = r.yt_scene
assert isinstance(yt_scene, Scene)
# mgui_region.fields.field_name.value = "temperature"
# mgui_region.left_edge.value.value = (0.4, 0.4, 0.4)
# mgui_region.right_edge.value.value = (0.6, 0.6, 0.6)
# r.load_data()
# # should have read from cache, check the log:
# assert yt_ugrid_ds_fn in caplog.text
# # the viewer should now have two images
# assert len(viewer.layers) == 2
#
# temp_layer = viewer.layers[1]
# assert temp_layer.metadata["_yt_napari_layer"] is True
#
# r.clear_cache()
# assert len(dataset_cache.available) == 0
#
# _ = r.yt_scene
# yt_scene = r.yt_scene
# assert isinstance(yt_scene, Scene)

0 comments on commit 88302dc

Please sign in to comment.