diff --git a/tests/test_widgets.py b/tests/test_widgets.py index a2acd34..eb36902 100644 --- a/tests/test_widgets.py +++ b/tests/test_widgets.py @@ -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