docstr: Test blocking setting of the optimizer.
docstr_tok: ["Test","blocking","setting","of","the","optimizer","."]
code: def test_blocking(self, finite_diff_step, seed):
      """Test blocking setting of the optimizer."""
      regularization = 1e-3
      stepsize = 1.0
      history_length = 5
      opt = qml.QNSPSAOptimizer(
          stepsize=stepsize,
          regularization=regularization,
          finite_diff_step=finite_diff_step,
          resamplings=1,
          blocking=True,
          history_length=history_length,
          seed=seed,
      )
      qnode, params_shape = get_single_input_qnode()
      # params minimizes the qnode
      params = np.tensor([3.1415, 0]).reshape(params_shape)
  
      # fill opt.last_n_steps array with a minimum expectation value
      for _ in range(history_length):
          opt.step_and_cost(qnode, params)
      # blocking should stop params from updating from this minimum
      new_params, _ = opt.step_and_cost(qnode, params)
      assert np.allclose(new_params, params)
  
file_path: pennylane/tests/optimize/test_qnspsa.py
imports: from copy import deepcopy
  import pytest
  from scipy.linalg import sqrtm
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 8 for calling the TestQNSPSAOptimizer obj's underlying member method code with example usage: obj.test_blocking(finite_diff_step, seed) without return types