def test_city(self, faker, num_samples):
    city_pattern: Pattern = re.compile('(?P<city_name>.*?)[市縣]?')
    for _ in range(num_samples):
        city = faker.city()
        assert isinstance(city, str)
        match = city_pattern.fullmatch(city)
        assert match
        assert (match.group('city_name') in ZhTwAddressProvider.cities)
def test_city(self, faker, num_samples):
    city_pattern: Pattern = re.compile('(?P<city_name>.*?)[市縣]?')
    for _ in range(num_samples):
        city = faker.city()
        assert isinstance(city, str)
        match = city_pattern.fullmatch(city)
        assert match
        assert (match.group('city_name') in ZhTwAddressProvider.cities)