Skip to content

Cell numbers are off by 1 compared to what you see in the notebook #171

Open
@peytondmurray

Description

@peytondmurray

Hi all, I noticed the cell numbers reported by nbval are off by one from what you see in a jupyter notebook. Jupyter notebooks measure cell execution starting from 1, whereas nbval starts from 0. It would be a nice quality-of-life change to have the errors reported by nbval match up with the cell numbers in the notebook.

Here's an example notebook where I've generated output which doesn't match the expected output for the cell contents:

image

Notice that the cell number is 1 after freshly running the notebook from the beginning.

image

Here, pytest fails as expected, but the failure is in Cell 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions