Skip to content

Add a Python TESTed example for expected exceptions - #62

Merged
TomNaessens merged 1 commit into
masterfrom
feature/8847-tested-python-parse-positive
Oct 19, 2026
Merged

TomNaessens merged 1 commit into
masterfrom
feature/8847-tested-python-parse-positive

Conversation

@TomNaessens

@TomNaessens TomNaessens commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Adds tested/python/parse-positive/, a small Python example of TESTed's expected-exception check: parse_positive(text) returns the integer for "42" and "7", and raises ValueError("not a positive number") for "0", "-3" and "abc". TESTed checks both the exception type and the message. The Python examples had no exception example yet. It sits in tested/python/, where #63 moves the other Python examples; tested/dirconfig.json already makes it Python, so it works whether or not #63 has merged.

The same exercise exists in C#, C++, Kotlin, JavaScript and TypeScript (each with its own exception type), as decided for https://github.com/dodona-edu/dodona/issues/8847: one small exercise per TESTed feature.

Manual testing instructions

  1. In a Dodona dev checkout with seeded data, check out this branch in the local clone of the example repository under data/exercises/ (git fetch && git checkout feature/8847-tested-python-parse-positive).
  2. Sign in as zeus (http://dodona.localhost:3000/dev_sign_in/1), open that repository's page and reprocess its activities.
  3. Open "Parse a positive number" and submit tested/python/parse-positive/solution/solution.py: all 5 tests pass.
  4. Edge case: raise TypeError instead of ValueError: the two valid cases pass and the three exception cases fail.
Verification (dodona-authoring verify skill, ghcr.io/dodona-edu/dodona-tested, universal-judge master)
  • DSL validation: valid.
  • Reference solution: 5/5 correct; run the way Dodona does with natural_language en and nl: 5/5 each.
  • Wrong solution (# wrong): 0/5 correct.
  • TypeError instead of ValueError: 2/5 correct (the three exception cases fail).

🤖 Generated with Claude Code

@TomNaessens TomNaessens added the enhancement New feature or request label Oct 19, 2026
@TomNaessens TomNaessens self-assigned this Oct 19, 2026
@TomNaessens
TomNaessens force-pushed the feature/8847-tested-python-parse-positive branch from 1b4044a to c38566c Compare October 19, 2026 16:42
@TomNaessens
TomNaessens marked this pull request as ready for review October 19, 2026 19:26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TomNaessens
TomNaessens force-pushed the feature/8847-tested-python-parse-positive branch from c38566c to 6695260 Compare October 19, 2026 19:29
@TomNaessens
TomNaessens enabled auto-merge October 19, 2026 19:34
@TomNaessens
TomNaessens merged commit bbca43e into master Oct 19, 2026
11 checks passed
@TomNaessens
TomNaessens deleted the feature/8847-tested-python-parse-positive branch October 19, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants