We're celebrating World Quantum Day 2022! Join us

cirq.testing.assert_repr_pretty

Assert that the given object has a _repr_pretty_ method that produces the given text.

val The object to test.
text The string that _repr_pretty_ is expected to return.
cycle The value of cycle passed to _repr_pretty_. cycle represents whether the call is made with a potential cycle. Typically one should handle the cycle equals True case by returning text that does not recursively call the _repr_pretty_ to break this cycle.

AssertionError If _repr_pretty_ does not pretty print the given text.