![]() |
Allows deprecated functions, classes, decorators in tests.
cirq.testing.assert_deprecated(
*msgs,
deadline: str = False,
allow_multiple_warnings: bool = False
)
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
Args | |
---|---|
msgs
|
messages that should match the warnings captured |
deadline
|
the expected deadline the feature will be deprecated by. Has to follow the format vX.Y (minor versions only) |
allow_multiple_warnings
|
if True, multiple warnings are accepted. Typically this should not be used, by default it's False. |