bugGNU Octave - Bugs: bug #65644, jupyter-notebook tests fail if a...


bug #65644: jupyter-notebook tests fail if a figure is already open

Submitter:  Nicholas Jankowski <nrjank>
Submitted:  Fri 26 Apr 2024 02:57:57 AM UTC
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Fri 26 Apr 2024 04:17:57 AM UTC, comment #2: 

@Anonymous - i'm not sure what exactly you're suggesting.  I see those three lines in the test, but the test still fails.

Nicholas Jankowski <nrjank>
Group Member
Fri 26 Apr 2024 04:04:42 AM UTC, comment #1: 

visibility = get (0, "defaultfigurevisible");

set (0, "defaultfigurevisible", "off");

set (0, "defaultfigurevisible", visibility);

No error.

Fri 26 Apr 2024 02:57:57 AM UTC, original submission:  

as noticed over on bug #65641 when a test accidentally left a figure window up during the test suite,  that window being present caused a jupyter-notebook test to fail. This can be verified with just testing jupyter-notebook.

with no figures open:

close all
test jupyter-notebook.tst
PASSES 4 out of 4 tests

close all
test jupyter-notebook.tst
***** testif HAVE_RAPIDJSON
 visibility = get (0, "defaultfigurevisible");
 toolkit = graphics_toolkit ();
   if (! strcmp (graphics_toolkit (), "qt"))
       graphics_toolkit ("gnuplot");
       ## The system doesn't support gnuplot for drawing hidden
       ## figures.  Just return and have test marked as passing.
   set (0, "defaultfigurevisible", "off");

   n = jupyter_notebook (fullfile ("octave_kernel.ipynb"));
   n.run_all ();

   ## Test embedding images
   assert (n.notebook.cells{3}.outputs{1}.output_type, "display_data")
   assert (isfield (n.notebook.cells{3}.outputs{1}.data, "image/png"));
   assert (getfield (n.notebook.cells{3}.outputs{1}.data, "text/plain"),
           {"<IPython.core.display.Image object>"});

   ## Test running non-code cells
   markdown_cell = n.notebook.cells{1};
   n.run (1);
   assert (markdown_cell, n.notebook.cells{1});

   ## Test embedding textual output
   assert (n.notebook.cells{6}.outputs{1}.output_type, "stream")
   assert (n.notebook.cells{6}.outputs{1}.name, "stdout");
   set (0, "defaultfigurevisible", visibility);
   graphics_toolkit (toolkit);
!!!!! test failed
get: invalid handle (= 2)

Nicholas Jankowski <nrjank>
Group Member


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by nrjank (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code