Repository navigation
curriculum: add actionable assertion messages to pathlib checks #106
Description
Motivation
Bare assertions report only AssertionError, which does not tell a beginner what behavior was expected. Each hidden check should fail with a short, actionable message without changing what the exercise tests.
Current evidence
An exhaustive AST audit on dev at e1d4dae37234b75124bd6a53f06734296ebbbdee found 10 assert nodes without messages in this batch:
checks/pathlib/pathlib1.py: 2checks/pathlib/pathlib2.py: 1checks/pathlib/pathlib3.py: 3checks/pathlib/pathlib4.py: 1checks/pathlib/pathlib5.py: 1checks/pathlib/pathlib6.py: 2
Reproduce from the repository root:
import ast
from pathlib import Path
files = [
'checks/pathlib/pathlib1.py',
+ 'checks/pathlib/pathlib2.py',
+ 'checks/pathlib/pathlib3.py',
+ 'checks/pathlib/pathlib4.py',
+ 'checks/pathlib/pathlib5.py',
+ 'checks/pathlib/pathlib6.py'
]
for filename in files:
tree = ast.parse(Path(filename).read_text(encoding="utf-8"))
missing = sum(
isinstance(node, ast.Assert) and node.msg is None
for node in ast.walk(tree)
)
print(filename, missing)The full audit found 270 missing messages across 121 check files. This ticket is limited to 6 files and 10 messages.
Exact scope
Add a non-empty, beginner-facing message to each currently bare assertion in the listed files. Preserve every assertion predicate, execution order, helper statement, and success print.
Acceptance checklist
- All 10 currently bare assertions in the listed files have non-empty messages.
- Each message states the expected behavior or value in terms a learner can act on.
- Messages include the actual value when it is readily available and useful.
- Assertion predicates, ordering, side effects, and success output are unchanged.
- No check outside the listed files is changed.
- All 292 reference answers continue to pass.
- Changed check code remains Python 3.9 compatible.
Explicit exclusions
Do not change learner exercises, reference solutions, solutions/_answers.py, hints, documentation URLs, manifest order, exercise names, or curriculum semantics. Difficulty sequencing remains in #17, and contribution-guide wording remains in #39.
Likely files
checks/pathlib/pathlib1.pychecks/pathlib/pathlib2.pychecks/pathlib/pathlib3.pychecks/pathlib/pathlib4.pychecks/pathlib/pathlib5.pychecks/pathlib/pathlib6.py
Verification
python -m pytest tests/integration/test_solution_verify.py -q
python -m pytest -q
pythonlings --root tests/fixtures/passing_curriculum verifyRerun the AST probe above and confirm every listed count is zero.
Sprint coordination
See Discussion #37 and tracker #52. This issue is intentionally unassigned. A coordination comment is welcome, but it does not reserve the issue. The first pull request that satisfies every acceptance criterion and verification requirement is considered for merge.
Activity
coderabbitai commentedon Aug 18, 2026
🔗 Related PRs
#31 - feat: overall progress, completion celebration, first-launch welcome (
#14,#15,#16) [merged]#66 - release: promote v0.4.2 to main [merged]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!