-
Notifications
You must be signed in to change notification settings - Fork 7
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
Catch unhandled exceptions from pytest. #266
Conversation
- And retry the given test. - Also, disable all pytest stdout capturing with -s option. This seems to clash with img-proof which already redirects stdout to a log file. https://docs.pytest.org/en/stable/capture.html
img_proof/ipa_cloud.py
Outdated
try: | ||
result = pytest.main(cmds, plugins=[plugin]) | ||
except Exception: | ||
result = 2 |
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.
Why 2?
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.
Pytest returns 1 if tests fail, 0 if sucess and any of 2, 3, 4 if there's some sort of handled exception. So 2 is arbitrary, it could be 2, 3 or 4. Below this section where the results are handled if the result is in (2, 3, 4) img-proof only adds a generic error instead of trying to parse the plugin report which won't exist in exception cases.
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.
Consider adding that to the README and/or documentation.
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.
Will add comments before merge.
Add a comment to point to pytest error code link and use error code 3 which match exception cases. |
seems to clash with img-proof which already redirects stdout to a
log file. https://docs.pytest.org/en/stable/capture.html