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

Use TestError instead of AssertionError in test to avoid confusion #7503

Merged

Conversation

kozlovsky
Copy link
Contributor

Some tests (of the Core test suite) deliberately raise an AssertionError and expect it to be in error_handler._handled_exceptions. It is better to raise a specific TestError instead of a generic AsserionError not to be confused about whether the error was planned or unexpected. In this PR, I change AssertionError to TestError to avoid possible confusion.

The reason I want to fix it is that I had observed seen some strange cases when the string "AssertionError" was in error_handler._handled_exceptions while it was expected to be empty (unfortunately can't provide an example right now), and I want to eliminate possible cases of it.

@kozlovsky kozlovsky requested review from a team and drew2a and removed request for a team June 26, 2023 12:11
@kozlovsky kozlovsky changed the title Use TestError instead of AddertionError in test to avoid confusion Use TestError instead of AssertionError in test to avoid confusion Jun 26, 2023
@kozlovsky kozlovsky force-pushed the fix/raising_assertion_error_in_test branch 2 times, most recently from 2df2d27 to 2920e0c Compare June 26, 2023 12:30
@drew2a
Copy link
Contributor

drew2a commented Jun 26, 2023

Related to #7495

@kozlovsky kozlovsky force-pushed the fix/raising_assertion_error_in_test branch from 2920e0c to bd769f1 Compare June 26, 2023 13:20
@kozlovsky kozlovsky force-pushed the fix/raising_assertion_error_in_test branch from bd769f1 to 179d5f7 Compare June 26, 2023 13:53
@kozlovsky kozlovsky merged commit 178f583 into Tribler:release/7.13 Jun 27, 2023
@kozlovsky kozlovsky deleted the fix/raising_assertion_error_in_test branch June 27, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants