Skip to content

Feature Request: doctest for code-cell #290

@jakevdp

Description

@jakevdp

It would be useful to be able to doctest myst-nb notebooks within a sphinx project. For example, sphinx.ext.doctest provides the testcode and testoutput directives that let you do something like this in myst-md:

```{testcode}
1 + 2
```

```{testoutput}
4
```

It would be nice if a similar mechanism existed to specify expected outputs for myst-nb code-cells; e.g.

```{code-cell}
1 + 1
```

```{code-cell-output}
2
```

If this were automatically tested in the same way that testcode and testoutput are, it would make it easier to detect when myst-nb docs get stale.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions