Skip to content

Add actionable assertion messages to all batch-1 functional checks - #150

Open
mercael91 wants to merge 1 commit into
abhiksark:devfrom
mercael91:fix/issue-86
Open

mercael91 wants to merge 1 commit into
abhiksark:devfrom
mercael91:fix/issue-86

Conversation

@mercael91

@mercael91 mercael91 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Closes #86.

Adds beginner-facing messages to every bare assertion listed in the issue (9 asserts across 6 files):

  • checks/functional/functional1.py - square(0)
  • checks/functional/functional2.py - absolute(0), absolute(-100)
  • checks/functional/functional3.py - isinstance(doubled, list)
  • checks/functional/functional4.py - isinstance(evens, list), the even-numbers check over evens
  • checks/functional/functional5.py - first and last item of by_length
  • checks/functional/functional6.py - apply_twice(lambda x: x + 1, 0)

Each message states what was expected and what the code produced instead; the ones guarding a value's shape (map/filter results, sorted list) also name the likely cause, e.g. "wrap map(...) in list(...)". Predicates, assertion order and the success prints are unchanged.

Verified locally by running each check through the repository runner (pythonlings.core.runner.run) against the reference answers in solutions/_answers.py: all six pass, and wrong answers fail with the new messages.

@coderabbitai

coderabbitai Bot commented Sep 17, 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: Advanced

Run ID: 27d9e2dc-6622-4a66-9e05-b802db9f02e5

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.

Covers every bare assert listed in abhiksark#86 - 9 asserts across
checks/functional/functional1..6 - so a failing check tells a beginner what was
expected and what the code produced instead. Assert predicates, order and the
success prints are unchanged.

Assertions that guard a value shape (map/filter results, sorted lists) also name
the likely cause, e.g. "wrap map(...) in list(...)".
@mercael91 mercael91 changed the title Add actionable assertion messages to functional checks in functional3.py Add actionable assertion messages to all batch-1 functional checks Sep 17, 2026
@mercael91

Copy link
Copy Markdown
Contributor Author

Pushed an update: Add actionable assertion messages to all batch-1 functional checks. Ready for re-review when you have a moment.

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