fab icon indicating copy to clipboard operation
fab copied to clipboard

Add doctest

Open hiker opened this issue 1 year ago • 2 comments

To make sure that examples in the documentation actually work, we need to add support for doctest in the doc directory.

hiker avatar Nov 26 '24 08:11 hiker

We don't have examples in docstrings at present, so it is not clear what using the doctest would add.

t00sa avatar Aug 05 '25 12:08 t00sa

Not (only) docstrings, I wrote documentation, e.g. we should try to test in advanced_config.rst examples like:

A profile is defined as follows:

.. code-block::
    :linenos:

    tr = ToolRepository()
    gfortran = tr.get_tool(Category.FORTRAN_COMPILER, "gfortran")

    gfortran.define_profile("base")
    gfortran.define_profile("fast-debug", inherit_from="base")
    gfortran.define_profile("full-debug", inherit_from="fast-debug")

Not all might be possible of course, but making sure that the examples we have there actually work would be great.

hiker avatar Aug 05 '25 12:08 hiker