class_docstr: Unit tests for the pennylane.qnn.keras.KerasLayer class.
class_docstr_tok: ["Unit","tests","for","the","pennylane.qnn.keras.KerasLayer","class","."]
docstr: Test if an ImportError is raised when instantiated with an incorrect version of
  TensorFlow
docstr_tok: ["Test","if","an","ImportError","is","raised","when","instantiated","with","an","incorrect","version","of","TensorFlow"]
code: def test_bad_tf_version(
      self, get_circuit, output_dim, monkeypatch
  ):  # pylint: disable=no-self-use
      """Test if an ImportError is raised when instantiated with an incorrect version of
      TensorFlow"""
      c, w = get_circuit
      with monkeypatch.context() as m:
          m.setattr(qml.qnn.keras, "CORRECT_TF_VERSION", False)
          with pytest.raises(
              ImportError,
              match="KerasLayer requires TensorFlow version 2",
          ):
              KerasLayer(c, w, output_dim)
  
imports: from collections import defaultdict
  import numpy
  import pytest
  import pennylane
label_desc: Use image node_id 1 for calling the TestKerasLayer obj's underlying member method code with example usage: obj.test_bad_tf_version(get_circuit, output_dim, monkeypatch) without return types