Skip to content

fix(curriculum): add actionable itertools assertion messages - #131

Open
frobel0520 wants to merge 1 commit into
abhiksark:devfrom
frobel0520:fix/issue-100-itertools-messages
Open

fix(curriculum): add actionable itertools assertion messages#131
frobel0520 wants to merge 1 commit into
abhiksark:devfrom
frobel0520:fix/issue-100-itertools-messages

Conversation

@frobel0520

@frobel0520 frobel0520 commented Aug 22, 2026

Copy link
Copy Markdown

Summary

Adds actionable, beginner-facing messages to the seven bare assertions in the itertools checks requested by #100. The assertion predicates, execution order, helper statements, and success output are unchanged; only the six scoped check files are modified.

Closes #100

Tests

  • python -m pytest tests/integration/test_solution_verify.py -q — 1 passed
  • pythonlings --root tests/fixtures/passing_curriculum verify — passed
  • AST audit of the six scoped files — 0 bare assertions remaining
  • python -m pytest -q — 209 passed, 6 failed locally because Windows symlink creation is unavailable (WinError 1314); the failures are in existing symlink-security tests and are unrelated to this change

Screenshots

Not applicable; this is a curriculum check-message change.

Checklist

  • Documentation update not needed; this change only improves hidden assertion feedback
  • Added or updated tests — not needed; existing solution verification covers the reference answers
  • Verified python -m pytest -q — local Windows symlink privilege prevented six existing tests from running

Summary by CodeRabbit

  • Tests
    • Improved validation feedback for iterator-related checks.
    • Assertion failures now describe expected behavior and display the actual values received.
    • Clarified diagnostics for coordinates, grouped data, running totals, repeated values, placeholders, flattened results, and adjacent pairs.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8588a7d-6d85-4358-ab21-4f268bd6b60e

📥 Commits

Reviewing files that changed from the base of the PR and between 45e59aa and 50beb80.

📒 Files selected for processing (6)
  • checks/itertools/itertools3.py
  • checks/itertools/itertools4.py
  • checks/itertools/itertools5.py
  • checks/itertools/itertools6.py
  • checks/itertools/itertools7.py
  • checks/itertools/itertools8.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Maintain Python 3.9 compatibility. Guard standard-library APIs introduced in
newer Python versions and preserve required fallbacks.
Preserve the runner's isolated subprocess, five-second default timeout,
shared exercise/check namespace, and # I AM NOT DONE completion marker.
Preserve atomic state writes and corrupt-state backup. Do not discard learner
progress when changing state handling.

Files:

  • checks/itertools/itertools7.py
  • checks/itertools/itertools6.py
  • checks/itertools/itertools8.py
  • checks/itertools/itertools5.py
  • checks/itertools/itertools3.py
  • checks/itertools/itertools4.py
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: Preserve learner-edited exercises during workspace updates. Reset snapshots
and bundled curriculum updates must not overwrite learner work implicitly.
Report vulnerabilities privately. Never disclose them through public issues
or pull requests; follow SECURITY.md.
Use only pythonlings as the distribution name. Do not publish or document
this repository under a different package name.
Read RELEASE.md before changing versions, tags, release workflows, or
publishing behavior.

Files:

  • checks/itertools/itertools7.py
  • checks/itertools/itertools6.py
  • checks/itertools/itertools8.py
  • checks/itertools/itertools5.py
  • checks/itertools/itertools3.py
  • checks/itertools/itertools4.py
checks/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

checks/**/*.py: Checks must use bare assertions with actionable, beginner-facing messages. Keep
curriculum code self-contained because it is copied into learner workspaces.

Files:

  • checks/itertools/itertools7.py
  • checks/itertools/itertools6.py
  • checks/itertools/itertools8.py
  • checks/itertools/itertools5.py
  • checks/itertools/itertools3.py
  • checks/itertools/itertools4.py
🪛 Ruff (0.16.1)
checks/itertools/itertools7.py

[error] 1-1: Undefined name pairs

(F821)


[error] 3-3: Undefined name pairs

(F821)

checks/itertools/itertools6.py

[error] 1-1: Undefined name repeated

(F821)


[error] 3-3: Undefined name repeated

(F821)

checks/itertools/itertools8.py

[error] 1-1: Undefined name flattened

(F821)


[error] 3-3: Undefined name flattened

(F821)


[error] 5-5: Undefined name adjacent_pairs

(F821)


[error] 7-7: Undefined name adjacent_pairs

(F821)

checks/itertools/itertools5.py

[error] 1-1: Undefined name running_totals

(F821)


[error] 3-3: Undefined name running_totals

(F821)

checks/itertools/itertools3.py

[error] 1-1: Undefined name coordinates

(F821)


[error] 8-8: Undefined name coordinates

(F821)

checks/itertools/itertools4.py

[error] 1-1: Undefined name grouped

(F821)


[error] 6-6: Undefined name grouped

(F821)

🔇 Additional comments (6)
checks/itertools/itertools3.py (1)

1-9: LGTM!

checks/itertools/itertools4.py (1)

1-7: LGTM!

checks/itertools/itertools5.py (1)

1-4: LGTM!

checks/itertools/itertools6.py (1)

1-4: LGTM!

checks/itertools/itertools7.py (1)

1-4: LGTM!

checks/itertools/itertools8.py (1)

1-8: LGTM!


📝 Walkthrough

Walkthrough

The change adds actionable failure messages to seven assertions in six itertools check files. Assertion predicates, expected values, execution order, and success output remain unchanged.

Changes

Itinerable assertion diagnostics

Layer / File(s) Summary
Add diagnostic assertion messages
checks/itertools/itertools3.py, checks/itertools/itertools4.py, checks/itertools/itertools5.py, checks/itertools/itertools6.py, checks/itertools/itertools7.py, checks/itertools/itertools8.py
The seven assertions now describe the expected result and include actual values where applicable. The assertion conditions remain unchanged.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 50beb

This PR only adds actionable messages to existing itertools assertions without changing their predicates or execution behavior; no actionable merge-blocking risk remains beyond normal checks and review.

Poem

I’m a rabbit with tests in my den,
Now failures explain what went wrong again.
Coordinates and totals speak clear,
Groups and pairs show the answer near.
Seven messages hop into view—
The expected and actual values too!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding actionable assertion messages to the itertools checks.
Description check ✅ Passed The description includes the required summary, tests, screenshots, and checklist sections with relevant verification details.
Linked Issues check ✅ Passed The six modified files add messages to all seven targeted assertions while preserving predicates and reported verification for issue #100.
Out of Scope Changes check ✅ Passed All changes are limited to the six itertools check files specified by issue #100 and address only assertion messages.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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