Skip to content

Merge ARRAY_OF_EXCEPTIONS into COMPLEX_TYPES in test_official - #5367

Open
kurupdevs wants to merge 1 commit into
python-telegram-bot:masterfrom
kurupdevs:solve-test-official-todo
Open

kurupdevs wants to merge 1 commit into
python-telegram-bot:masterfrom
kurupdevs:solve-test-official-todo

Conversation

@kurupdevs

Copy link
Copy Markdown

Related to #4324

Resolves the TODO in tests/test_official/exceptions.py by merging ParamTypeCheckingExceptions.ARRAY_OF_EXCEPTIONS into COMPLEX_TYPES (one unchecked item of the tracking issue).

  • The six "Array of" exceptions are now entries in COMPLEX_TYPES, keyed by object name like all other entries, with string values that must be present in the parameter annotation.
  • check_param_type resolves them via extract_mappings(PTCE.COMPLEX_TYPES, ...) with identical return semantics.
  • Removed the now-unused Sequence import and the unreachable {"correct_option_ids": Sequence[int]} send_poll entry.

Behavior-preserving: verified with a script comparing old vs new exception-path decisions for all 6200 (object, parameter) pairs of telegram.Bot methods and telegram classes. ruff check, ruff format --check and py_compile pass.

Use "Related to #4324" (NOT "Closes") since #4324 is a tracking issue with other unchecked items.

Resolves the TODO in tests/test_official/exceptions.py by folding the
"Array of" type exceptions (previously keyed by (param_name, is_class))
into COMPLEX_TYPES, keyed by object name like the other entries.
check_param_type now looks the exceptions up via extract_mappings.

Behavior is unchanged: verified with a script comparing the old and new
exception-path decisions for all 6200 (object, parameter) pairs of
telegram.Bot methods and telegram classes, plus end-to-end
check_param_type runs on the affected parameters.

This branch has not been deployed

No deployments
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