class_docstr: Tests for loading data from external libraries.
class_docstr_tok: ["Tests","for","loading","data","from","external","libraries","."]
docstr: Test if an ImportError is raised when basis_set_exchange is requested but
  not installed.
docstr_tok: ["Test","if","an","ImportError","is","raised","when","basis_set_exchange","is","requested","but","not","installed","."]
code: def test_fail_import(self, monkeypatch):
      """Test if an ImportError is raised when basis_set_exchange is requested but
      not installed."""
  
      pytest.importorskip("basis_set_exchange")
  
      with monkeypatch.context() as m:
          m.setitem(sys.modules, "basis_set_exchange", None)
  
          with pytest.raises(
              ImportError,
              match="This feature requires basis_set_exchange",
          ):
              qchem.load_basisset("sto-3g", "H")
  
file_path: pennylane/tests/qchem/test_basis_set.py
imports: import sys
  import pytest
  from pennylane import numpy
  from pennylane import qchem
label_desc: Use image node_id 2 for calling the TestLoadBasis obj's underlying member method code with example usage: obj.test_fail_import(monkeypatch) without return types