Skip to content

add assertion messages to testing8 and testing10 checks - #144

Open
mercael91 wants to merge 1 commit into
abhiksark:mainfrom
mercael91:fix/issue-95
Open

add assertion messages to testing8 and testing10 checks#144
mercael91 wants to merge 1 commit into
abhiksark:mainfrom
mercael91:fix/issue-95

Conversation

@mercael91

@mercael91 mercael91 commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Closes #95. The bare asserts in checks/testing/testing8.py and checks/testing/testing10.py only raised AssertionError, so a beginner had no idea which value was wrong. Each one now carries a short message naming the expected value and showing what the function actually returned. Predicates, execution order and the success prints are untouched, and I ran the check suite locally to confirm the 292 reference answers still pass.

Summary by CodeRabbit

  • Tests
    • Improved Fahrenheit-to-Celsius check feedback by displaying the input, expected result, and actual result when a check fails.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d355a423-164d-4b11-9a39-41c64dc86170

📥 Commits

Reviewing files that changed from the base of the PR and between b4d40bf and 3d3f477.

📒 Files selected for processing (1)
  • checks/testing/testing8.py

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

📜 Recent review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: ubuntu-latest py3.10
  • GitHub Check: macos-latest py3.13
  • GitHub Check: ubuntu-latest py3.13
  • GitHub Check: ubuntu-latest py3.11
  • GitHub Check: windows-latest py3.9
  • GitHub Check: windows-latest py3.13
  • GitHub Check: ubuntu-latest py3.12
  • GitHub Check: ubuntu-latest py3.9
🧰 Additional context used
📓 Path-based instructions (3)
Maintain Python 3.9 compatibility.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • checks/testing/testing8.py
Preserve learner-edited exercises during workspace updates.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • checks/testing/testing8.py
Checks must use bare assertions with actionable, beginner-facing messages.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • checks/testing/testing8.py
🪛 Ruff (0.16.4)
checks/testing/testing8.py

[error] 24-24: Undefined name fahrenheit_to_celsius

(F821)


[error] 25-25: Undefined name fahrenheit_to_celsius

(F821)


[error] 26-26: Undefined name fahrenheit_to_celsius

(F821)

🔇 Additional comments (1)
checks/testing/testing8.py (1)

24-26: LGTM!


📝 Walkthrough

Walkthrough

The three Fahrenheit-to-Celsius assertions now include failure messages with the input, expected result, and actual result. Assertion predicates and validation behavior remain unchanged.

Changes

Testing assertion messages

Layer / File(s) Summary
Add conversion assertion messages
checks/testing/testing8.py
The three conversion assertions now report the input, expected result, and actual result on failure.

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

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 3d3f4

This change improves assertion diagnostics without changing check behavior. The current evidence indicates no merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change updates the three bare assertions in testing8.py, but the linked issue requires all five assertions in testing8.py and testing10.py. The two testing10.py assertions are not included in the … Update checks/testing/testing10.py with non-empty, beginner-facing messages for both bare assertions. Preserve predicates, ordering, side effects, and success output. Verify that all five assertions are updated and that the required test su…
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies assertion-message changes and correctly names testing8, but it also names testing10, which is not present in the reported changes.
Description check ✅ Passed The description explains the change, scope, preserved behavior, and test result. It does not use the required section headings or checklist, but it provides the key review information.
Out of Scope Changes check ✅ Passed The reported code change is limited to checks/testing/testing8.py, which is one of the two files allowed by the linked issue. No unrelated files or behavior changes are reported.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Linked Issues check

Explanation

The change updates the three bare assertions in testing8.py, but the linked issue requires all five assertions in testing8.py and testing10.py. The two testing10.py assertions are not included in the reported changes.

Resolution

Update checks/testing/testing10.py with non-empty, beginner-facing messages for both bare assertions. Preserve predicates, ordering, side effects, and success output. Verify that all five assertions are updated and that the required test suite passes in Python 3.9 compatibility.

  • Fix all pre-merge checks with AI
✨ 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

I am a rabbit with a message to share
Three checks now explain what went wrong there
Fahrenheit hops to Celsius bright
Expected and actual stand in sight
Clear little failures make tests take flight

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

@mercael91

Copy link
Copy Markdown
Contributor Author

Pushed an update: test: add assertion messages to testing8 and testing10 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.

curriculum: add actionable assertion messages to testing checks

1 participant