class_docstr: Tests for the ``optimize_measurements`` function.
docstr: Tests that NotImplementedError is raised for methods other than ``'qwc'``.
docstr_tok: ["Tests","that","NotImplementedError","is","raised","for","methods","other","than","``","'qwc","'","``","."]
code: def test_optimize_measurements_not_implemented_catch(self):
      """Tests that NotImplementedError is raised for methods other than ``'qwc'``."""
  
      observables = [PauliY(0), PauliX(0) @ PauliX(1), PauliZ(1)]
      grouping = "anticommuting"
  
      with pytest.raises(
          NotImplementedError,
          match="Measurement reduction by 'anticommuting' grouping not implemented",
      ):
          optimize_measurements(observables, grouping=grouping)
  
file_path: pennylane/tests/pauli/grouping/test_pauli_optimize_measurements.py
imports: import pytest
  import numpy
  from pennylane import Identity, PauliX, PauliY, PauliZ
  from pennylane.pauli import are_identical_pauli_words
  from pennylane.pauli.grouping.optimize_measurements import optimize_measurements
label_desc: Use image node_id 4 for calling the TestOptimizeMeasurements obj's underlying member method code with example usage: obj.test_optimize_measurements_not_implemented_catch() without return types