class_docstr: Tests regularization/postprocessing methods.
class_docstr_tok: ["Tests","regularization\/postprocessing","methods","."]
docstr: Test import error raising if cvxpy is not installed.
docstr_tok: ["Test","import","error","raising","if","cvxpy","is","not","installed","."]
code: def test_closest_psd_matrix_import_error(self, input, mocker):
      """Test import error raising if cvxpy is not installed."""
      with pytest.raises(ImportError) as import_error:
          mocker.patch.dict(sys.modules, {"cvxpy": None})
          _ = kern.closest_psd_matrix(
              input, fix_diagonal=True, feastol=1e-10
          )
  
      assert "CVXPY is required" in str(import_error.value)
  
imports: import math
  import sys
  from functools import partial
  import pytest
  import numpy
  import pennylane
  import pennylane.kernels
  from pennylane import numpy
label_desc: Use image node_id 7 for calling the TestRegularization obj's underlying member method code with example usage: obj.test_closest_psd_matrix_import_error(input, mocker) without return types