Skip to content
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

Fix validation for failed cells with zero points #1731

Merged
merged 2 commits into from
Mar 6, 2023

Conversation

tuncbkose
Copy link
Contributor

If a cell gets full points during validation, check if max_points is 0 and the cell actually failed. Fixes (part of) #1418.

If this looks good, I can also add some related tests.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 1, 2023

Binder 👈 Launch a Binder on branch AaltoSciComp/nbgrader/validate-fix

Copy link
Contributor

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @tuncbkose.
I just have a comment.

def has_failed(cell: NotebookNode) -> bool:
"""Returns True if the cell contains an output indicative of an error"""
if not cell.cell_type == 'code':
raise ValueError("cell is not a code cell, so it can't fail")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise ValueError("cell is not a code cell, so it can't fail")
return False

Maybe we don't need to raise here

@brichet
Copy link
Contributor

brichet commented Mar 6, 2023

Thanks @tuncbkose

@brichet brichet merged commit 52e88e5 into jupyter:main Mar 6, 2023
@tuncbkose tuncbkose deleted the validate-fix branch March 15, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants