New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correctly display prompt numbers that are 'None' #6706
Conversation
7599579
to
8ecadda
Compare
Would it be possible to add tests to catch regressions? |
I can definitely add tests for the live notebook. I'm not sure what the best way to test for it in the HTML/LaTeX output would be though -- maybe a regex match for the |
Ok, tests added. The one thing I didn't do though was add tests for the |
I think it's OK to leave that case untested. |
out_regex = r"Out\[(.*)\]:" | ||
|
||
ins = ["1", "2", "6", "7", "8", "10", "14", " ", " ", "*", "0"] | ||
outs = ["7", "10", "14"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think checking that the prompts exactly match this is a bit brittle, because if you e.g. add one cell for another test, this will break. I'm not sure what's a good way to write the test, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, true. I could create a new notebook in files/
that's specifically for testing prompt numbers, and is therefore less likely to be changed unless the prompt numbering tests are also changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Can we cut the prompt numbers test notebook down to just enough cells to test the different possibilities for prompt numbers? That just makes it clear what it's there for. |
Yup. Now it just includes cells/tests for: single-digit prompt number, double-digit prompt number, output prompt number, no prompt number, null prompt number, asterisk, and zero prompt number. |
Excellent, thanks. Merging. |
Correctly display prompt numbers that are 'None'
Sweet, thanks! |
Hmm, this is still a problem on nbviewer though because it's running 2.3.0. Should this be backported, or just wait for 3.0? |
Correctly display prompt numbers that are 'None'
Fixes #6702