class_docstr: Test the core functionality of the VQE module
class_docstr_tok: ["Test","the","core","functionality","of","the","VQE","module"]
docstr: Tests that the cost function returns correct expectation values
docstr_tok: ["Tests","that","the","cost","function","returns","correct","expectation","values"]
code: def test_cost_expvals(self, coeffs, observables, expected):
      """Tests that the cost function returns correct expectation values"""
      dev = qml.device("default.qubit", wires=2)
      hamiltonian = qml.Hamiltonian(coeffs, observables)
      cost = catch_warn_ExpvalCost(
          lambda params, **kwargs: None, hamiltonian, dev
      )
      assert cost([]) == sum(expected)
  
imports: import copy
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestVQE obj's underlying member method code with example usage: obj.test_cost_expvals(coeffs, observables, expected) without return types