-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 bug in rspy.test.check_throws #11441
Conversation
@@ -136,7 +136,7 @@ def print_stack(): | |||
""" | |||
Function for printing the current call stack. Used when an assertion fails | |||
""" | |||
log.out( 'Traceback (most recent call last):' ) | |||
log.e( 'Traceback (most recent call last):' ) |
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 should the print_stack
function fail the test?
The calling function should do that no?
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 just wanted the stack to show with a red -E-
, which this does. The stack is only printed on failure.
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.
log.e increase the error count
librealsense/unit-tests/py/rspy/log.py
Line 145 in b874e42
def e( *args ): |
So that's why I asked..
You would expect that some error checking will increase it and not a stack print function..
But you saw the output and if you think it's OK I will not object :)
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'll check it and make sure
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.
In unit-tests/run-unit-tests.py
, it fails the run if log.n_errors()
returns non-zero.
But there's no real count per-se. It's just used as a boolean. I'm OK with a stack trace being considered an error there, too.
Also, run-unit-tests
is not a test, so does not print stack traces -- those are only printed inside each actual test, and rspy.test
uses a different mechanism (test.n_failed_tests
) to detect failure.
OK?
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.
OK..
If nothing was thrown, it failed but nothing was printed...