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 bug in rspy.test.check_throws #11441

Merged
merged 1 commit into from
Feb 16, 2023
Merged

Conversation

maloel
Copy link
Collaborator

@maloel maloel commented Feb 15, 2023

If nothing was thrown, it failed but nothing was printed...

@maloel maloel requested a review from Nir-Az February 15, 2023 11:19
@@ -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):' )
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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

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 :)

Copy link
Collaborator Author

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

Copy link
Collaborator Author

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?

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK..

@maloel maloel merged commit 3096615 into IntelRealSense:development Feb 16, 2023
@maloel maloel deleted the test branch February 16, 2023 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants