How to use the wrapt.transient_function_wrapper function in wrapt

To help you get started, we’ve selected a few wrapt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ionelmc / python-lazy-object-proxy / tests / test_monkey_patching.py View on Github external
            @wrapt.transient_function_wrapper(__name__,
                    'TestMonkeyPatching._test_transient_function_wrapper')
            def __call__(self, wrapped, instance, args, kwargs):
                called.append((args, kwargs))
                _self.assertEqual(wrapped, _self._test_transient_function_wrapper)
                _self.assertEqual(instance, _self)
                _self.assertEqual(args, _args)
                _self.assertEqual(kwargs, _kwargs)
                return wrapped(*args, **kwargs)
github ionelmc / python-lazy-object-proxy / tests / test_monkey_patching.py View on Github external
        @wrapt.transient_function_wrapper(__name__,
                'TestMonkeyPatching._test_transient_function_wrapper')
        def wrapper(wrapped, instance, args, kwargs):
            called.append((args, kwargs))
            self.assertEqual(wrapped, self._test_transient_function_wrapper)
            self.assertEqual(instance, self)
            self.assertEqual(args, _args)
            self.assertEqual(kwargs, _kwargs)
            return wrapped(*args, **kwargs)