test(analyzer): strengthen GB phone regression coverage#2186
Draft
developer0hye wants to merge 2 commits into
Draft
test(analyzer): strengthen GB phone regression coverage#2186developer0hye wants to merge 2 commits into
developer0hye wants to merge 2 commits into
Conversation
Contributor
Author
|
The only failing CI check appears unrelated to this PR's changes.
The Analyzer jobs on Python 3.11, 3.13, and 3.14 passed, as did Linting. Python 3.12 was cancelled by matrix fail-fast after the Python 3.10 failure. As an external fork contributor, I cannot rerun upstream Actions ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change Description
Strengthen the regression coverage added with #2174 so it proves that
PhoneRecognizer.DEFAULT_SUPPORTED_REGIONSuses the valid libphonenumber region code"GB".The previous test reused a recognizer fixture that appends
JPandCNand only checked the deduplicated result's span and score. The national-format example could therefore still match through unrelated regional passes when"GB"was reverted to the unsupported"UK"value.This PR:
phonenumbers.SUPPORTED_REGIONS;GBtextual explanation; andThere is no production-code change. The user-facing impact is more reliable regression protection and a more precise changelog description.
Validation:
python -m pytest tests/test_phone_recognizer.py: 28 passed"GB"temporarily reverted to"UK": both new tests failgit diff --check: passedruff check tests/test_phone_recognizer.py: reports 25 pre-existing findings on unchanged lines; the added lines have no findingsIssue reference
Fixes #2185
Checklist