class_docstr: Further unit tests for some new methods of Device.
class_docstr_tok: ["Further","unit","tests","for","some","new","methods","of","Device","."]
docstr: Test that an exception is raised when a state is returned along with another return
  type
docstr_tok: ["Test","that","an","exception","is","raised","when","a","state","is","returned","along","with","another","return","type"]
code: def test_state_return_with_other_types(self):
      """Test that an exception is raised when a state is returned along with another return
      type"""
  
      dev = qml.device("default.qubit", wires=2)
  
      with qml.queuing.AnnotatedQueue() as q:
          qml.PauliX(wires=0)
          qml.state()
          qml.expval(qml.PauliZ(1))
  
      tape = qml.tape.QuantumScript.from_queue(q)
      res = qml.execute(tapes=[tape], device=dev, gradient_fn=None)[0]
      assert isinstance(res, tuple) and len(res) == 2
      assert np.array_equal(res[0], [0.0, 0.0, 1.0, 0.0])
      assert res[1] == 1.0
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane.measurements import MeasurementProcess
label_desc: Use image node_id 2 for calling the TestDeviceNewUnits obj's underlying member method code with example usage: obj.test_state_return_with_other_types() without return types