class_docstr: Test inputs and pre-processing.
class_docstr_tok: ["Test","inputs","and","pre-processing","."]
docstr: Tests that the correct error message is raised when the number
  of qutrits does not match the number of wires.
docstr_tok: ["Tests","that","the","correct","error","message","is","raised","when","the","number","of","qutrits","does","not","match","the","number","of","wires","."]
code: def test_error_num_qutrits(self, basis_state, wires):
      """Tests that the correct error message is raised when the number
      of qutrits does not match the number of wires."""
  
      with pytest.raises(
          ValueError, match="Basis states must be of (shape|length)"
      ):
          qml.QutritBasisStatePreparation(basis_state, wires)
  
file_path: pennylane/tests/templates/test_state_preparations/test_qutrit_basis_state_prep.py
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 1 for calling the TestInputs obj's underlying member method code with example usage: obj.test_error_num_qutrits(basis_state, wires) without return types