def test_current_country_errors(self):
    dt = providers.date_time
    countries_duplicated = [*dt.Provider.countries, *dt.Provider.countries]
    with mock.patch.object(dt.Provider, 'countries', countries_duplicated), pytest.raises(ValueError) as e:
        Faker('en_US').current_country()
    assert ('Ambiguous' in str(e))
    country_code = 'faker.providers.address.Provider.current_country_code'
    with pytest.raises(ValueError), mock.patch(country_code, (lambda self: 'en_ZZ')):
        Faker('en_US').current_country()
def test_current_country_errors(self):
    dt = providers.date_time
    countries_duplicated = [*dt.Provider.countries, *dt.Provider.countries]
    with mock.patch.object(dt.Provider, 'countries', countries_duplicated), pytest.raises(ValueError) as e:
        Faker('en_US').current_country()
    assert ('Ambiguous' in str(e))
    country_code = 'faker.providers.address.Provider.current_country_code'
    with pytest.raises(ValueError), mock.patch(country_code, (lambda self: 'en_ZZ')):
        Faker('en_US').current_country()