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 folding function as expected
docstr_tok: ["Tests","that","arguments","are","passed","to","the","folding","function","as","expected"]
code: def test_folding_call(self, mocker):
      """Tests that arguments are passed to the folding function as expected"""
      spy = mocker.spy(self, "folding")
      scale_factors = [1, 2, -4]
      folding_kwargs = {"Hello": "goodbye"}
  
      mitigate_with_zne(
          tape,
          scale_factors,
          self.folding,
          self.extrapolate,
          folding_kwargs,
      )
  
      args = spy.call_args_list
  
      for i in range(3):
          same_tape(args[i][0][0], tape_base)
      assert [args[i][0][1] for i in range(3)] == scale_factors
      assert all(args[i][1] == folding_kwargs for i in range(3))
  
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 1 for calling the TestMitigateWithZNE obj's underlying member method code with example usage: obj.test_folding_call(mocker) without return types