Skip to content
  • Alexandre Duret-Lutz's avatar
    ltsmin-pml: work around newer jupyter versions · 186d2063
    Alexandre Duret-Lutz authored
    Newer Jupyter version are able to capture the system's stdout and
    stderr to display it in the notebook.  This is done asynchronously,
    with a thread polling those file descriptor.  While this will help us
    debug (finaly we can see the tracing code we put in C++) this causes
    two issues for testing.  One is the asynchronous behaviour, which
    makes it very hard to reproduce notebooks.  The second issue is that
    older version of Jupyter used to hide some of the prints from the
    notebook, so it is hard to accommodate both.
    
    In the case of the ltsmin-pml notebook, loading the PML file from
    a filename used to trigger a compilation silently (with output on the
    console, but not in the notebook).  The newer version had the output
    of that compilation spread into two cells.
    
    * python/spot/ltsmin.i: Work around the issue by triggering the
    compilation from Python, and capturing its output explicitly, so it
    work with all Jupyter versions.  Also adjust to use the more recent
    and simpler subprocess.run() interface, available since Python 3.5.
    * tests/python/ltsmin-pml.ipynb: Adjust expected output.
    * tests/python/ipnbdoctest.py (canonicalize): Adjust patterns.
    186d2063