class_docstr: Unit tests for the _batch_transform helper function.
class_docstr_tok: ["Unit","tests","for","the","_batch_transform","helper","function","."]
docstr: Test that a warning is raised if the the batch transform is requested to not be used.
docstr_tok: ["Test","that","a","warning","is","raised","if","the","the","batch","transform","is","requested","to","not","be","used","."]
code: def test_warns_if_requested_off(self):
      """Test that a warning is raised if the the batch transform is requested to not be used."""
  
      # pylint: disable=too-few-public-methods
      class CustomOp(qml.operation.Operator):
          """Dummy operator."""
  
          def decomposition(self):
              return [qml.PauliX(self.wires[0])]
  
      dev = DefaultQubit()
  
      qs = qml.tape.QuantumScript(
          [CustomOp(0)], [qml.expval(qml.PauliZ(0))]
      )
  
      with pytest.warns(
          UserWarning,
          match="device batch transforms cannot be turned off",
      ):
          program, _ = dev.preprocess()
          qml.execute(
              (qs, qs),
              device=dev,
              device_batch_transform=False,
              transform_program=program,
          )
  
file_path: pennylane/tests/interfaces/default_qubit_2_integration/test_execute_default_qubit_2.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.workflow.execution import _preprocess_expand_fn
  from pennylane.devices import DefaultQubit
label_desc: Use image node_id 1 for calling the TestBatchTransformHelper obj's underlying member method code with example usage: obj.test_warns_if_requested_off() and returns: list