def test_postcode_in_province(self, faker, num_samples):
    for _ in range(num_samples):
        for province_abbr in EnCaAddressProvider.provinces_abbr:
            code = faker.postcode_in_province(province_abbr)
            assert (code[0] in EnCaAddressProvider.provinces_postcode_prefixes[province_abbr])
            with pytest.raises(Exception):
                faker.postcode_in_province('XX')
def test_postcode_in_province(self, faker, num_samples):
    for _ in range(num_samples):
        for province_abbr in EnCaAddressProvider.provinces_abbr:
            code = faker.postcode_in_province(province_abbr)
            assert (code[0] in EnCaAddressProvider.provinces_postcode_prefixes[province_abbr])
            with pytest.raises(Exception):
                faker.postcode_in_province('XX')