bundles / numpy 2.4.4 / numpy / testing / _private / utils / decorate_methods
function
numpy.testing._private.utils:decorate_methods
Signature
def decorate_methods ( cls , decorator , testmatch = None ) Summary
Apply a decorator to all methods in a class matching a regular expression.
Extended Summary
The given decorator is applied to all public methods of cls that are matched by the regular expression testmatch (testmatch.search(methodname)). Methods that are private, i.e. start with an underscore, are ignored.
Parameters
cls: classClass whose methods to decorate.
decorator: functionDecorator to apply to methods
testmatch: compiled regexp or str, optionalThe regular expression. Default value is None, in which case the nose default (
re.compile(r'(?:^|[\b_\.%s-])[Tt]est' % os.sep)) is used. Iftestmatchis a string, it is compiled to a regular expression first.
Aliases
-
numpy.testing.decorate_methods