# Path: sigtools/wrappers.py
# def wrappers(obj):
#     """For introspection purposes, returns an iterable that yields each
#     wrapping function of obj(as done through `wrapper_decorator`, outermost
#     wrapper first.
# 
#     Continuing from the `wrapper_decorator` example::
# 
#         >>> list(wrappers.wrappers(as_list))
#         [<<function print_call at 0x7f28d721a950> with signature print_call(func, *args,
#          _show_return=True, **kwargs)>]
# 
#     """
#     while True:
#         try:
#             wrappers = obj._sigtools__wrappers
#         except AttributeError:
#             return
#         for wrapper in wrappers:
#             yield wrapper
#         obj = obj.__wrapped__
# 
# Path: sigtools/support.py
# def read_sig(sig_str, ret=_util.UNSET, *,
#              use_modifiers_annotate=False,
#              use_modifiers_posoargs=sys.version_info < (3, 8),
#              use_modifiers_kwoargs=False,
#     ):
# def func_code(names, return_annotation, annotations, posoarg_n,
#               kwoarg_n, params, use_modifiers_annotate,
#               pre='', name='func',
#     ):
# def make_func(source, locals=None, name='func', future_features=()):
# def f(sig_str, ret=_util.UNSET, *, pre='', locals=None, name='func', future_features=(), **kwargs):
# def s(*args, **kwargs):
# def func_from_sig(sig):
# def make_up_callsigs(sig, extra=2):
# def bind_callsig(sig, args, kwargs):
# def sort_callsigs(sig, callsigs):
# def test_func_sig_coherent(func, check_return=True, check_invalid=True):
# DEBUG_STDLIB=False
# 
# Path: sigtools/signatures.py

# 
# Path: sigtools/tests/util.py
# def conv_first_posarg(sig):
# def func_to_name(func):
# def transform_exp_sources(d, subject=None):
# def transform_real_sources(d):
#     def assertSigsEqual(self, found, expected, *args, **kwargs):
#     def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
#     def downgrade_sig(self, sig):
# class SignatureTests(unittest.TestCase):


from sigtools import wrappers, support, signatures
from sigtools.tests.util import tup, Fixtures
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.




class WrapperDecoratorTests(Fixtures):
    def _test(self, func, sig_str, args, kwargs, ret, decorators):
        """Tests .wrappers.wrapper_decorator

        Checks its reported signature, that it chains functions correctly
        and that it reports its decorators properly via .wrappers.wrappers
        """
        self.assertSigsEqual(signatures.signature(func), support.s(sig_str))
        self.assertEqual(func(*args, **kwargs), ret)
        self.assertEqual(

# Path: sigtools/wrappers.py
# def wrappers(obj):
#     """For introspection purposes, returns an iterable that yields each
#     wrapping function of obj(as done through `wrapper_decorator`, outermost
#     wrapper first.
# 
#     Continuing from the `wrapper_decorator` example::
# 
#         >>> list(wrappers.wrappers(as_list))
#         [<<function print_call at 0x7f28d721a950> with signature print_call(func, *args,
#          _show_return=True, **kwargs)>]
# 
#     """
#     while True:
#         try:
#             wrappers = obj._sigtools__wrappers
#         except AttributeError:
#             return
#         for wrapper in wrappers:
#             yield wrapper
#         obj = obj.__wrapped__
# 
# Path: sigtools/support.py
# def read_sig(sig_str, ret=_util.UNSET, *,
#              use_modifiers_annotate=False,
#              use_modifiers_posoargs=sys.version_info < (3, 8),
#              use_modifiers_kwoargs=False,
#     ):
# def func_code(names, return_annotation, annotations, posoarg_n,
#               kwoarg_n, params, use_modifiers_annotate,
#               pre='', name='func',
#     ):
# def make_func(source, locals=None, name='func', future_features=()):
# def f(sig_str, ret=_util.UNSET, *, pre='', locals=None, name='func', future_features=(), **kwargs):
# def s(*args, **kwargs):
# def func_from_sig(sig):
# def make_up_callsigs(sig, extra=2):
# def bind_callsig(sig, args, kwargs):
# def sort_callsigs(sig, callsigs):
# def test_func_sig_coherent(func, check_return=True, check_invalid=True):
# DEBUG_STDLIB=False
# 
# Path: sigtools/signatures.py

# 
# Path: sigtools/tests/util.py
# def conv_first_posarg(sig):
# def func_to_name(func):
# def transform_exp_sources(d, subject=None):
# def transform_real_sources(d):
#     def assertSigsEqual(self, found, expected, *args, **kwargs):
#     def assertSourcesEqual(self, found, expected, func=None, depth_order=False):
#     def downgrade_sig(self, sig):
# class SignatureTests(unittest.TestCase):


# Path: sigtools/tests/test_wrapper_decorator.py
from sigtools import wrappers, support, signatures
from sigtools.tests.util import tup, Fixtures

# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.




class WrapperDecoratorTests(Fixtures):
    def _test(self, func, sig_str, args, kwargs, ret, decorators):
        """Tests .wrappers.wrapper_decorator

        Checks its reported signature, that it chains functions correctly
        and that it reports its decorators properly via .wrappers.wrappers
        """
        self.assertSigsEqual(signatures.signature(func), support.s(sig_str))
        self.assertEqual(func(*args, **kwargs), ret)
        self.assertEqual(

            list(wrappers.wrappers(func)),