def test_view_failed_delitem(attr):
    adata = gen_adata((10, 10))
    view = adata[5:7, :][:, :5]
    adata_hash = joblib.hash(adata)
    view_hash = joblib.hash(view)

    with pytest.raises(KeyError):
        getattr(view, attr).__delitem__("not a key")

    assert view.is_view
    assert adata_hash == joblib.hash(adata)
    assert view_hash == joblib.hash(view)
def _load_from_data(self, data):
        self._replay_data = data
        self._verify_toplevel_json(self._replay_data)

        self._rpms = self._replay_data.get("rpms", [])
        self._assert_type(self._rpms, list, "rpms", "array")

        self._groups = self._replay_data.get("groups", [])
        self._assert_type(self._groups, list, "groups", "array")

        self._environments = self._replay_data.get("environments", [])
        self._assert_type(self._environments, list, "environments", "array")