Skip to content

Commit

Permalink
fix jupyter lab nb of matplotlib canvases
Browse files Browse the repository at this point in the history
Sometimes in jupyter lab 5 canvases exist, one is not displayable and
can be ignored. In this fix we filter out all canvases that are not
displayable.
  • Loading branch information
agoscinski committed Dec 25, 2023
1 parent 11c7e79 commit 356cb6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ def test_cue_figure(
# in the notebook an image of the python logo is shown as first canvas, so
# we remove it
matplotlib_canvases = matplotlib_canvases[1:]
elif JUPYTER_TYPE == "lab":
# sometimes another canvas is shown that we filter out
matplotlib_canvases = [
canvas for canvas in matplotlib_canvases if canvas.is_displayed()
]

assert (
len(matplotlib_canvases) >= nb_expected_canvases
Expand Down

0 comments on commit 356cb6d

Please sign in to comment.