Skip to content

Improve actionable assertion messages in async checks - #121

Merged
abhiksark merged 2 commits into
abhiksark:devfrom
Nish12345944:fix/async-assertion-messages
Aug 21, 2026
Merged

Improve actionable assertion messages in async checks#121
abhiksark merged 2 commits into
abhiksark:devfrom
Nish12345944:fix/async-assertion-messages

Conversation

@Nish12345944

Copy link
Copy Markdown
Contributor

Summary

Improves the assertion messages in the async curriculum checks so failures provide clearer and more actionable feedback to learners.

Changes

  • Added an actionable assertion message to async7.py
  • Added an actionable assertion message to async8.py
  • Added an actionable assertion message to async9.py
  • Added an actionable assertion message to async10.py

Testing

  • Ran python -m pytest -q
  • Verified the four targeted assertions have actionable messages
  • The local test suite currently reports 195 passed and 13 failed due to existing Windows-specific environment issues

Closes #110

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ec23adf0-8f1d-44e2-b404-a0882545b576

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@abhiksark

Copy link
Copy Markdown
Owner

Thank you for working on this. I reviewed the exact PR head (1976ee1). The assertion-message changes themselves are correct: the predicates and ordering remain unchanged, all four messages are reachable and actionable, the full suite passes here with 208 tests, the reference-solution test passes, the bundled passing curriculum verifies successfully, Python 3.9 syntax parsing passes, and git diff --check is clean.

Before this is ready to merge, please address all of the following:

  1. Complete and record the required validation. The PR description currently reports 195 passed and 13 failed, but it does not identify or resolve those failures. It also omits the required passing-curriculum verification, package build, forced wheel reinstall, and relevant installed-flow commands and results. Please run every required curriculum validation gate and record the exact commands and outcomes in the PR description. The PR should remain in draft until this validation is complete.

  2. Add the required file-location comment as the first line of every changed Python file:

    • checks/async/async7.py

    • checks/async/async8.py

    • checks/async/async9.py

    • checks/async/async10.py

  3. Wrap the new assertion lines in async7.py, async9.py, and async10.py. They are currently 102, 108, and 143 characters, exceeding the 80-character limit required by the repository Google Python style instruction. Please use implicit continuation without changing the predicates or learner-facing messages.

GitHub currently reports the PR as UNSTABLE, with CodeRabbit as the only visible status context and no test CI result. A focused regression test for the four failure-message strings would also be useful, but I am treating that as a testing improvement rather than an additional blocker.

Once the three required items above are updated and the exact validation is recorded, this should be straightforward to re-review.

Adds the repo-relative path comment to async7-10 and wraps the three lines
that ran to 102, 108 and 143 columns. The message is parenthesised, never the
condition -- assert (cond, msg) is an always-true assert on a tuple.

Matches the form used for async1-6 in abhiksark#123, so the topic is consistent.
@abhiksark

Copy link
Copy Markdown
Owner

Thanks @Nish12345944 — the message content was good, so rather than send this back I've pushed the two formatting items from my review directly to your branch. We're landing it for the 0.4.4 release.

Path headers added to all four files (# checks/async/async7.py etc.), including async8.py, which needed it even though its line length was already fine.

Three lines wrapped — they ran to 102, 108 and 143 columns:

assert asyncio.run(double_all([1, 2, 3])) == [2, 4, 6], (
    "double_all() should return [2, 4, 6] for [1, 2, 3]"
)

Note the parentheses wrap the message only. assert (cond, msg) would be an assert on a non-empty tuple, which is always true and silently disables the check — worth knowing generally.

This matches the form #123 used for async1–6, so the async topic is now consistent, and between the two PRs checks/async/ drops from 10 bare assertions to 0.

Verified: all 10 async reference solutions pass, and the messages fire correctly on wrong answers. Your commit is untouched; mine sits on top.

Also — you were asked for the 80-column rule and the header convention when neither was documented anywhere. That was our gap, and both are now written down in CONTRIBUTING.md.

@abhiksark
abhiksark merged commit 5fc0b7c into abhiksark:dev Aug 21, 2026
6 checks passed
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