Skip to content

Add soft assertions (scoped accumulator, aggregate failures)#359

Merged
JE-Chen merged 2 commits into
devfrom
feat/soft-assert-batch
Jun 23, 2026
Merged

Add soft assertions (scoped accumulator, aggregate failures)#359
JE-Chen merged 2 commits into
devfrom
feat/soft-assert-batch

Conversation

@JE-Chen

@JE-Chen JE-Chen commented Jun 23, 2026

Copy link
Copy Markdown
Member

assert_all takes a pre-built spec list up front — there was no scoped accumulator you sprinkle check() calls into across interleaved actions that raises everything on block exit (JUnit5 assertAll / Playwright expect.soft / AssertJ SoftAssertions).

  • SoftAssertions context manager: check(condition, message) records pass/fail (never raises mid-block, returns the bool to branch on), check_equal shortcut, failures / passed accessors, assert_all() raises the aggregate. __exit__ calls assert_all on a clean exit and never masks an exception already propagating; raise_on_exit=False collects without auto-raising.
  • AC_soft_assert aggregates a JSON checks list ({value, op, expected, message}, op = eq/ne/gt/lt/contains/truthy) → {ok, passed, failures}, reporting all failures; raise_on_fail to raise.
  • Pure-stdlib; fully headless-testable. Wired through all 5 layers + headless test + EN/Zh docs + WHATS_NEW. Qt-free.

@codacy-production

codacy-production Bot commented Jun 23, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 33 complexity · 0 duplication

Metric Results
Complexity 33
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@JE-Chen JE-Chen merged commit c5830ea into dev Jun 23, 2026
16 checks passed
@JE-Chen JE-Chen deleted the feat/soft-assert-batch branch June 23, 2026 03:26
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant