class_docstr: Test conversion of queues to DAGs
class_docstr_tok: ["Test","conversion","of","queues","to","DAGs"]
docstr: Tests if the circuit prints correct.
docstr_tok: ["Tests","if","the","circuit","prints","correct","."]
code: def test_print_contents(self):
      """Tests if the circuit prints correct."""
      ops = [qml.Hadamard(wires=0), qml.CNOT(wires=[0, 1])]
      obs_w_wires = [qml.measurements.sample(op=None, wires=[0, 1, 2])]
  
      circuit_w_wires = CircuitGraph(
          ops, obs_w_wires, wires=Wires([0, 1, 2])
      )
  
      f = io.StringIO()
      with contextlib.redirect_stdout(f):
          circuit_w_wires.print_contents()
      out = f.getvalue().strip()
  
      expected = """Operations\n==========\nHadamard(wires=[0])\nCNOT(wires=[0, 1])\n\nObservables\n===========\nsample(wires=[0, 1, 2])"""
      assert out == expected
  
imports: import io
  import contextlib
  import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.resource import ResourcesOperation, Resources
  from pennylane.circuit_graph import CircuitGraph
  from pennylane.wires import Wires
label_desc: Use image node_id 14 for calling the TestCircuitGraph obj's underlying member method code with example usage: obj.test_print_contents() without return types