Skip to content

Add @do annotation coverage tests#333

Open
proboscis wants to merge 1 commit intomainfrom
issue/gh-333-annotation-coverage/run-20260315-114759
Open

Add @do annotation coverage tests#333
proboscis wants to merge 1 commit intomainfrom
issue/gh-333-annotation-coverage/run-20260315-114759

Conversation

@proboscis
Copy link
Copy Markdown
Owner

Summary

  • add tests/public_api/test_do_annotation_coverage.py
  • cover the 11 requested @do auto-unwrap annotation variations end-to-end through the real runtime pipeline
  • exercise from __future__ import annotations resolution by keeping the whole test module on string annotations and asserting the raw annotation stays a string

Acceptance Criteria Evidence

  1. One test file with all variations
  • Added tests/public_api/test_do_annotation_coverage.py
  1. Annotated ProgramLike/Effect/DoExpr args are not auto-unwrapped
  • Covered by test_program_varargs_annotation_preserves_program_objects
  • Covered by test_doexpr_varargs_annotation_preserves_program_objects
  • Covered by test_programlike_varargs_annotation_preserves_program_and_effect_objects
  • Covered by test_program_union_with_none_annotation_preserves_program_object
  • Covered by test_annotated_program_annotation_preserves_program_object
  • Covered by test_effect_varargs_annotation_preserves_effect_objects
  • Covered by test_effect_subclass_annotation_preserves_custom_effect_object
  • Covered by test_future_annotations_are_resolved_through_the_do_pipeline
  1. Baseline tests verify unannotated/Any/str varargs do auto-unwrap
  • Covered by test_unannotated_varargs_auto_unwrap_programlike_values
  • Covered by test_any_varargs_auto_unwrap_programlike_values
  • Covered by test_str_varargs_auto_unwrap_programlike_values
  1. Tests were run through the actual @do pipeline
$ uv run pytest tests/public_api/test_do_annotation_coverage.py
collected 11 items
tests/public_api/test_do_annotation_coverage.py ...........              [100%]
============================== 11 passed in 0.04s ==============================

$ uv run pytest tests/public_api/test_types_001_kpc.py tests/public_api/test_varargs_program_no_unwrap.py tests/public_api/test_do_annotation_coverage.py
collected 40 items
tests/public_api/test_types_001_kpc.py .........................         [ 62%]
tests/public_api/test_varargs_program_no_unwrap.py ....                  [ 72%]
tests/public_api/test_do_annotation_coverage.py ...........              [100%]
============================== 40 passed in 0.16s ==============================

$ uv run ruff check tests/public_api/test_do_annotation_coverage.py
All checks passed!

Refs gh-333-annotation-coverage

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