Skip to content
8 changes: 6 additions & 2 deletions presidio-analyzer/tests/test_phone_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

@pytest.fixture(scope="module")
def recognizer():
return PhoneRecognizer()
return PhoneRecognizer(
supported_regions=PhoneRecognizer.DEFAULT_SUPPORTED_REGIONS + ("JP", "CN")
)



Expand All @@ -24,6 +26,8 @@ def recognizer():
("_: +55 11 98456 5666", 1, ["PHONE_NUMBER"], ((3, 20), ), 0.4),
("Brazil: +55 11 98456 5666", 1, ["PHONE_NUMBER"], ((8, 25), ), 0.4),
("BR: +55 11 98456 5666", 1, ["PHONE_NUMBER"], ((4, 21), ), 0.4),
("My Japanese number is 090-1234-5678", 1, ["PHONE_NUMBER"],((22, 35), ), 0.4),
("My CN number is 13812345678", 1, ["PHONE_NUMBER"],((16, 27), ), 0.4),
# fmt: on
],
)
Expand Down Expand Up @@ -135,4 +139,4 @@ def test_get_analysis_explanation():
phone_recognizer = PhoneRecognizer()
test_region = "US"
explanation = phone_recognizer._get_analysis_explanation(test_region)
assert explanation.recognizer == "PhoneRecognizer"
assert explanation.recognizer == "PhoneRecognizer"