Skip to content

Improve exception rendering in parametrized tests #690

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

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

EgorkaKulikov
Copy link
Collaborator

@EgorkaKulikov EgorkaKulikov commented Aug 9, 2022

Description

Parametrized tests may contain reflective call in it's body or not.
If we do not have them, we should just catch Throwable and verify that it's type has one type with the expected one.
Otherwise we should catch InvocationTargetException and verify that it's targetException has one type with the expected one.
We should also wrap with try/catch block only the method call with the related assert, not all statements before too.

Also fixes # (641)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Refactoring (typos and non-functional changes)

How Has This Been Tested?

Automated Testing

utbot-samples pipeline passing is enough

Manual Scenario

Several typical scenarios for parametrized tests including tests with expected exceptions.

@EgorkaKulikov EgorkaKulikov enabled auto-merge (squash) August 9, 2022 11:48
@EgorkaKulikov EgorkaKulikov requested a review from ArsenHD August 9, 2022 11:48
@EgorkaKulikov EgorkaKulikov force-pushed the egor/pseudo_exception_var_name branch from b12a3d9 to 72bb265 Compare August 9, 2022 12:02
@EgorkaKulikov EgorkaKulikov merged commit 6488a07 into main Aug 9, 2022
@EgorkaKulikov EgorkaKulikov deleted the egor/pseudo_exception_var_name branch August 9, 2022 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants