def allow_deprecated_cirq_rigetti_use_in_tests(func):  # coverage: ignore
    """Decorator to allow deprecated classes and functions in tests and to suppress warnings."""

    @functools.wraps(func)
    @unittest.mock.patch.dict(os.environ, ALLOW_DEPRECATION_IN_TEST="True")
    def wrapper(*args, **kwargs):
        with block_overlapping_deprecation(_DEPRECATION_FIX_MSG):
            return func(*args, **kwargs)

    return wrapper
Decorator to allow deprecated classes and functions in tests and to suppress warnings.
cirq-rigetti/cirq_rigetti/deprecation.py