-
Notifications
You must be signed in to change notification settings - Fork 51
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
Unexpected behavior on cells tagged with "raises-exception" #108
Comments
Off the top of my head, if you ensure that nbval checks the output of the cell, then the exception |
@vidartf Thanks for the quick response! I've now installed If the notebook is un-executed (i.e. no outputs are stored), However, if the outputs are stored in the notebook file, If I use Note, however, that if |
Thanks for the feedback. I'll look a bit further into the current behavior, but for now I just want to clear up that |
Raising an error or not seems like the domain of the kernel, and should not be done by the front-end (it might report an error to the user e.g. with a dialog, but again, not as an exception in the output). It also does not strike me as something the notebook server should get itself involved with. |
I cannot reproduce this behavior. If I edit the
|
But you kept the old cell output? Then But if I re-execute the cell, generating a new (possibly empty, but definitely non-exception) output and save the notebook, then all 6 tests pass again (which is a bug). BTW I'm using the latest
You are right, the front-end should show some kind of error and stop further execution, but raising an exception in the notebook context doesn't make sense at all. I should have thought about this before posting my comment above. I was thinking about |
Yes, this is for example what you would expect if the code initially produced an error, but now no longer does (nbval will then catch that behavior).
If during your normal operation, you do not generate an error, and you save such a state to the repo, then I would not expect nbval to see this as a fault. Can you expand upon a use-case where this would be the case? Note that #109 now fixes the case for cells that are stored in an un-executed state (i.e. the |
This is the case about which I said above (#108 (comment)): "Which IMHO is a bug, but it may be a bug in the tool that initially executed the notebook and not a bug in So yes, it may be fine if
I don't have a use case other than using a buggy tool to generate the cell outputs. It may need some more convincing from my side, but I hope |
I didn't try it, but according to @takluyver (see jupyter/nbconvert#730 (comment)),
nbval
does not raise an error if a cell tagged withraises-exception
does not raise an exception.I think that not raising an exception in a
raises-exception
cell should generally (in every Jupyter-related tool) be an error and @takluyver said (jupyter/nbconvert#730 (comment)):How about raising an error in that case?
Related issue on
nbconvert
: jupyter/nbconvert#730Related issue on
notebook
: jupyter/notebook#4198Related issue on
jupyterlab
: jupyterlab/jupyterlab#2412The text was updated successfully, but these errors were encountered: