def test_dictproxy(self): v = {} x = MutableMappingProxy(lambda: v) x['foo'] = 42 assert x['foo'] == 42 assert len(x) == 1 assert 'foo' in x del (x['foo']) with pytest.raises(KeyError): x['foo'] assert iter(x)
def test_dictproxy(self): v = {} x = MutableMappingProxy(lambda: v) x["foo"] = 42 assert x["foo"] == 42 assert len(x) == 1 assert "foo" in x del x["foo"] with pytest.raises(KeyError): x["foo"] assert iter(x)
def s(self, *, orig): return MutableMappingProxy(lambda: orig)