class_docstr: Tests for :class:`pennylane.data.mapper.AttributeTypeMapper`.
class_docstr_tok: ["Tests","for",":","class",":","`","pennylane.data.mapper.AttributeTypeMapper","`","."]
docstr: Test that set_item() only captures a ValueError if it is
  caused by a HDF5 file not being writeable.
docstr_tok: ["Test","that","set_item","(",")","only","captures","a","ValueError","if","it","is","caused","by","a","HDF5","file","not","being","writeable","."]
code: def test_set_item_other_value_error(self, monkeypatch):
      """Test that set_item() only captures a ValueError if it is
      caused by a HDF5 file not being writeable."""
      monkeypatch.setattr(
          pennylane.data.base.mapper,
          "match_obj_type",
          MagicMock(side_effect=ValueError("Something")),
      )
  
      with pytest.raises(ValueError, match="Something"):
          AttributeTypeMapper(create_group()).set_item("x", 1, None)
  
file_path: pennylane/tests/data/base/test_mapper.py
imports: from unittest.mock import MagicMock
  import pytest
  import pennylane.data.base.mapper
  from pennylane.data import AttributeInfo, Dataset, DatasetScalar
  from pennylane.data.base.hdf5 import create_group
  from pennylane.data.base.mapper import AttributeTypeMapper
label_desc: Use image node_id 3 for calling the TestMapper obj's underlying member method code with example usage: obj.test_set_item_other_value_error(monkeypatch) without return types