Table Of Contents

Previous topic

neurospin.utils.zscore

Next topic

testing.nitest

This Page

testing.decorators

Module: testing.decorators

Use numpy testing framework which is based on nose as of v1.2

Extend the decorators to use nipy’s gui and data labels.

Functions

nipy.testing.decorators.knownfailure(f)
nipy.testing.decorators.make_label_dec(label, ds=None)

Factory function to create a decorator that applies one or more labels.

Parameters:label : string or sequence One or more labels that will be applied by the decorator to the functions

it decorates. Labels are attributes of the decorated function with their value set to True.

Keywords:ds : string An optional docstring for the resulting decorator. If not given, a default docstring is auto-generated.
Returns:A decorator.
Examples:
>>> from nipy.testing import make_label_dec
>>> slow = make_label_dec('slow')
>>> print slow.__doc__
Labels a test as 'slow'
>>> from nipy.testing import make_label_dec
>>> rare = make_label_dec(['slow','hard'],
... "Mix labels 'slow' and 'hard' for rare tests")
>>> @rare
... def f(): pass
...
>>>
>>> f.slow
True
>>> f.hard
True
nipy.testing.decorators.needs_review(msg)

Skip a test that needs further review.

Parameters:

msg : string

msg regarding the review that needs to be done