|View source on GitHub|
Allows deprecated functions, classes, decorators in tests.
cirq.testing.assert_deprecated( *msgs, deadline: str = 1, count: Optional[int] = 1 )
It acts as a contextmanager that can be used in with statements:
>>> with assert_deprecated("use cirq.x instead", deadline="v0.9"): >>> # do something deprecated
||messages that should match the warnings captured|
||the expected deadline the feature will be deprecated by. Has to follow the format vX.Y (minor versions only)|
||if None count of messages is not asserted, otherwise the number of deprecation messages have to equal count.|