Skip to content

test: add test_api_contracts with Editor/Document method coverage check#52

Merged
nathanjmcdougall merged 1 commit into
mainfrom
test/editor-document-method-coverage
May 26, 2026
Merged

test: add test_api_contracts with Editor/Document method coverage check#52
nathanjmcdougall merged 1 commit into
mainfrom
test/editor-document-method-coverage

Conversation

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

Addresses doc/todo/editor-method-boilerplate.md.

Introduces tests/test_api_contracts.py — a new module for structural API invariants, separate from behaviour tests (test_editor.py) and public-namespace tests (test_public_api.py).

Two tests:

  • test_editor_exposes_all_document_mutation_methods: fails if a new Document method is added without a corresponding Editor wrapper.
  • test_document_only_set_is_accurate: fails if the intentional-omission list (_DOCUMENT_ONLY) becomes stale (e.g. if dump were ever added to Editor).

Currently passing. _DOCUMENT_ONLY = {"dump", "dumps", "has_anchors", "query_pretty"}.

@nathanjmcdougall nathanjmcdougall merged commit 05a1797 into main May 26, 2026
18 checks passed
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