code: def test_verbose(self, capsys):
      var1 = MyVariable("var1")
      var2 = MyVariable("var2")
      var3 = op1(var2, var1)
      fg = FunctionGraph([var1, var2], [var3], clone=False)
  
      rv_feature = ReplaceValidate()
      fg.attach_feature(rv_feature)
      rv_feature.replace_all_validate(
          fg, [(var3, var1)], reason="test-reason", verbose=True
      )
  
      capres = capsys.readouterr()
      assert capres.err == ""
      assert (
          "rewriting: rewrite test-reason replaces Op1.0 of Op1(var2, var1) with var1 of None"
          in capres.out
      )
  
      class TestFeature(Feature):
          def validate(self, *args):
              raise Exception()
  
      fg.attach_feature(TestFeature())
  
      with pytest.raises(Exception):
          rv_feature.replace_all_validate(
              fg, [(var3, var1)], reason="test-reason", verbose=True
          )
  
      capres = capsys.readouterr()
      assert "rewriting: validate failed on node Op1.0" in capres.out
  
file_path: pytensor/tests/graph/test_features.py
imports: import pytest
  from pytensor.graph.basic import Apply, Variable
  from pytensor.graph.features import Feature, NodeFinder, ReplaceValidate
  from pytensor.graph.fg import FunctionGraph
  from pytensor.graph.op import Op
  from pytensor.graph.type import Type
  from tests.graph.utils import MyVariable, op1
label_desc: Use image node_id 1 for calling the TestReplaceValidate obj's underlying member method code with example usage: obj.test_verbose(capsys) without return types