class_docstr: Tests for the mitigate_with_zne function
class_docstr_tok: ["Tests","for","the","mitigate_with_zne","function"]
docstr: Tests that arguments are passed to the extrapolate function as expected
docstr_tok: ["Tests","that","arguments","are","passed","to","the","extrapolate","function","as","expected"]
code: def test_extrapolate_call(self, mocker):
      """Tests that arguments are passed to the extrapolate function as expected"""
      spy = mocker.spy(self, "extrapolate")
      scale_factors = [1, 2, -4]
      random_results = [0.1, 0.2, 0.3]
      extrapolate_kwargs = {"Hello": "goodbye"}
  
      tapes, fn = mitigate_with_zne(
          tape,
          scale_factors,
          self.folding,
          self.extrapolate,
          extrapolate_kwargs=extrapolate_kwargs,
      )
      res = fn(random_results)
      assert res == 3.141
  
      args = spy.call_args
      assert args[0][0] == scale_factors
      assert np.allclose(args[0][1], random_results)
  
      assert args[1] == extrapolate_kwargs
  
      for t in tapes:
          same_tape(t, tape)
  
imports: from functools import partial
  import pytest
  from packaging import version
  import pennylane
  from pennylane import numpy
  from pennylane.tape import QuantumScript
  from pennylane.transforms import mitigate_with_zne, richardson_extrapolate, fold_global
label_desc: Use image node_id 2 for calling the TestMitigateWithZNE obj's underlying member method code with example usage: obj.test_extrapolate_call(mocker) without return types