@mock.patch(PYCOUNTRY)
def test_invalid_lookup_raises_keyerror(self, mocked_pycountry):
    mocked_pycountry.side_effect = ([KeyError(), KeyError(), KeyError()] * 2)
    with pytest.raises(KeyError) as e:
        country_iso_code('Fake Country')
    assert ('Fake Country not found' in str(e.value))
    country_iso_code.cache_clear()
@mock.patch(PYCOUNTRY)
def test_invalid_lookup_raises_keyerror(self, mocked_pycountry):
    mocked_pycountry.side_effect = ([KeyError(), KeyError(), KeyError()] * 2)
    with pytest.raises(KeyError) as e:
        country_iso_code('Fake Country')
    assert ('Fake Country not found' in str(e.value))
    country_iso_code.cache_clear()