Skip to content

test: fail tests when no exception is thrown - #7948

Open
sharanggupta wants to merge 1 commit into
alibaba:mainfrom
sharanggupta:test-assert-throws
Open

sharanggupta wants to merge 1 commit into
alibaba:mainfrom
sharanggupta:test-assert-throws

Conversation

@sharanggupta

Copy link
Copy Markdown

What this PR does / why we need it?

Issue1854, Issue1543_1544, CustomErrorMessageTest and CSVTest4 checked the exception only in a catch block with no fail() after the call, so they passed even if the call stopped throwing. They now use assertThrows, and Issue1854 still calls the same assertValidate overloads.

中文

Issue1854、Issue1543_1544、CustomErrorMessageTest 和 CSVTest4 只在 catch 块里检查异常,调用之后没有 fail(),所以即使调用不再抛出异常,测试也会通过。现在改用 assertThrows,Issue1854 仍然调用相同的 assertValidate 重载。

Summary of your change

Test-only: 33 catch-only checks in four test classes now use assertThrows.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

Issue1854, Issue1543_1544, CustomErrorMessageTest and CSVTest4 checked
the exception only in a catch block with no fail() after the call, so
they passed even if the call stopped throwing.
@CLAassistant

CLAassistant commented Nov 6, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@wenshao wenshao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No issues found. LGTM! ✅

中文说明

未发现问题。LGTM!✅

— DeepSeek-V4.1-Flash-1017@fda99a87 via Qwen Code /review (v0.27.3)

This branch has not been deployed

No deployments
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.

3 participants