# Path: openfermioncirq/_compat.py
# def wrap_module(module: ModuleType,
#                 deprecated_attributes: Dict[str, Tuple[str, str]]):
#     """Wrap a module with deprecated attributes.
# 
#     Args:
#         module: The module to wrap.
#         deprecated_attributes: A dictionary from attribute name to pair of
#             strings, where the first string gives the version that the attribute
#             will be removed in, and the second string describes what the user
#             should do instead of accessing this deprecated attribute.
# 
#     Returns:
#         Wrapped module with deprecated attributes.
#     """
# 
#     class Wrapped(ModuleType):
# 
#         __dict__ = module.__dict__
# 
#         def __getattr__(self, name):
#             if name in deprecated_attributes:
#                 version, fix = deprecated_attributes[name]
#                 warnings.warn(
#                     f'{name} was used but is deprecated.\n'
#                     f'It will be removed in '
#                     f'openfermioncirq {version}.\n'
#                     f'{fix}\n',
#                     DeprecationWarning,
#                     stacklevel=2)
#             return getattr(module, name)
# 
#     return Wrapped(module.__name__, module.__doc__)


from typing import Any, Callable
from openfermioncirq._compat import wrap_module
import functools
import warnings
import pytest
import deprecation
import openfermioncirq as ofc
    """

    @functools.wraps(test)
    def decorated_test(*args, **kwargs) -> Any:
        with pytest.deprecated_call():
            test(*args, **kwargs)

    return decorated_test


@deprecation.deprecated()
def f():
    pass


def test_deprecated_test():

    @deprecated_test
    def test():
        f()

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter('ignore')
        warnings.simplefilter('default', DeprecationWarning)
        test()
        assert len(w) == 0


def test_wrap_module():
    ofc.deprecated_attribute = None

# Path: openfermioncirq/_compat.py
# def wrap_module(module: ModuleType,
#                 deprecated_attributes: Dict[str, Tuple[str, str]]):
#     """Wrap a module with deprecated attributes.
# 
#     Args:
#         module: The module to wrap.
#         deprecated_attributes: A dictionary from attribute name to pair of
#             strings, where the first string gives the version that the attribute
#             will be removed in, and the second string describes what the user
#             should do instead of accessing this deprecated attribute.
# 
#     Returns:
#         Wrapped module with deprecated attributes.
#     """
# 
#     class Wrapped(ModuleType):
# 
#         __dict__ = module.__dict__
# 
#         def __getattr__(self, name):
#             if name in deprecated_attributes:
#                 version, fix = deprecated_attributes[name]
#                 warnings.warn(
#                     f'{name} was used but is deprecated.\n'
#                     f'It will be removed in '
#                     f'openfermioncirq {version}.\n'
#                     f'{fix}\n',
#                     DeprecationWarning,
#                     stacklevel=2)
#             return getattr(module, name)
# 
#     return Wrapped(module.__name__, module.__doc__)


# Path: openfermioncirq/_compat_test.py
from typing import Any, Callable
from openfermioncirq._compat import wrap_module
import functools
import warnings
import pytest
import deprecation
import openfermioncirq as ofc

    """

    @functools.wraps(test)
    def decorated_test(*args, **kwargs) -> Any:
        with pytest.deprecated_call():
            test(*args, **kwargs)

    return decorated_test


@deprecation.deprecated()
def f():
    pass


def test_deprecated_test():

    @deprecated_test
    def test():
        f()

    with warnings.catch_warnings(record=True) as w:
        warnings.simplefilter('ignore')
        warnings.simplefilter('default', DeprecationWarning)
        test()
        assert len(w) == 0


def test_wrap_module():
    ofc.deprecated_attribute = None

    wrapped_ofc = wrap_module(ofc, {'deprecated_attribute': ('', '')})