MCPcopy Create free account
hub / github.com/ipython/ipython / apply_wrapper

Function apply_wrapper

IPython/testing/decorators.py:69–82  ·  view source on GitHub ↗

Apply a wrapper to a function for decoration. This mixes Michele Simionato's decorator tool with nose's make_decorator, to apply a wrapper in a decorator so that all nose attributes, as well as function signature and other properties, survive the decoration cleanly. This will ensure

(wrapper, func)

Source from the content-addressed store, hash-verified

67# Utility functions
68
69def apply_wrapper(wrapper, func):
70 """Apply a wrapper to a function for decoration.
71
72 This mixes Michele Simionato's decorator tool with nose's make_decorator,
73 to apply a wrapper in a decorator so that all nose attributes, as well as
74 function signature and other properties, survive the decoration cleanly.
75 This will ensure that wrapped functions can still be well introspected via
76 IPython, for example.
77 """
78 warnings.warn("The function `apply_wrapper` is deprecated since IPython 4.0",
79 DeprecationWarning, stacklevel=2)
80 import nose.tools
81
82 return decorator(wrapper,nose.tools.make_decorator(func)(wrapper))
83
84
85def make_label_dec(label, ds=None):

Callers

nothing calls this directly

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected