View source on GitHub |
Allows deprecated functions, classes, decorators in tests.
@contextlib.contextmanager
cirq.testing.assert_deprecated( *msgs, deadline: str, count: Optional[int] = 1 ) -> Iterator[None]
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