-
Notifications
You must be signed in to change notification settings - Fork 25
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
Use "status" prop and other misc improvements #27
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c825062
Mark failing tests with "status" key
isaacl 16a4ad0
Fix status for partial scores
isaacl e14dcf7
fix score key error
isaacl 078c116
Fix error concat
isaacl 44f5755
Adjust msg based on testing
isaacl 312c09f
Adjust msg spacing
isaacl 59d9534
better failure display
isaacl b78a4eb
Update json_test_runner.py
isaacl aad3b60
Revert test failure output format change
ibrahima eceabb0
Ensure that output is always a string
ibrahima 964305a
Add back empty output check
isaacl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could you revert this output change for now? Thanks! I am not sure if it makes sense generally and it would be good to isolate this change from the test status change in any case. I think adding the newlines after the test output is helpful, but I would prefer it if you could change the format of the error message back to
"Test Failed: {0}\n".format(err[1])
for now.Also, the
f'string'
formatting is a Python 3 feature, and the library should currently work on Python 2 otherwise so it'd be nice to maintain that. I know Python 2 is EOL and people should upgrade, but sometimes it feels like there's not a lot of time for that in education, and I wouldn't want to disrupt a Python-2-using instructor if we don't have to.Also, I was under the impression that the
unittest
assertions generally always have some error message, does the<no msg>
thing occur in practice? In any case I would expect that the autograder author should ideally be providing more helpful error messages anyway. If anything, I would prefer it to just say"Test Failed."
if there is no message inerr[1]
rather than"Test Failed: <no msg>"
, it feels cleaner that way.Incidentally, with the
unittest
library you can set thelongMessage
attribute on a test case to override the default error message formatting, so you could use that to tweak the output as well. You'd still have the "Test Failed" part, but then you could remove the default "assertion failed" message and add in extra whitespace, etc. But that wouldn't help with adding newlines between the other output and the test failure message.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.
Happy to split this into separate PR.
I think "Fail: " or "Failed: " is easier to parse than "Test Failed: ".
Students need to differentiate the prefix from the actual failure message and I think the space in "Test Failed" makes such differentiation harder.
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've never seen it, just was coding defensively since
err
itself can beNone
and wasn't sure whethererr[1]
could similarly beNone
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.
Split to #29