class_docstr: Test the Rotoselect (gradient-free) optimizer
class_docstr_tok: ["Test","the","Rotoselect","(","gradient-free",")","optimizer"]
docstr: Tests that step my raise an error.
docstr_tok: ["Tests","that","step","my","raise","an","error","."]
code: def test_rotoselect_optimizer_raises(self):
      """Tests that step my raise an error."""
      rotoselect_opt = RotoselectOptimizer()
  
      def cost_fn():
          return None
  
      with pytest.raises(
          ValueError, match="must be equal to the number of generators"
      ):
          rotoselect_opt.step(cost_fn, [0.2], [qml.PauliX, qml.PauliZ])
  
file_path: pennylane/tests/optimize/test_rotoselect.py
imports: import itertools
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.optimize import RotoselectOptimizer
label_desc: Use image node_id 3 for calling the TestRotoselectOptimizer obj's underlying member method code with example usage: obj.test_rotoselect_optimizer_raises() and returns: None