def test_set(cache):
    'Set item in cache.'
    with pytest.raises(KeyError):
        cache.get('key')
    cache.set('key', 'value')
    assert (cache.get('key') == 'value')
Set item in cache.
def test_set(cache):
    
    with pytest.raises(KeyError):
        cache.get('key')
    cache.set('key', 'value')
    assert (cache.get('key') == 'value')