NIPY logo

Site Navigation

NIPY Community

Table Of Contents

Next topic

io.imageformats.testing.nosepatch

This Page

io.imageformats.testing.lightunit

Module: io.imageformats.testing.lightunit

Lightweight testing that remains unittest-compatible.

This module exposes decorators and classes to make lightweight testing possible in a manner similar to what nose allows, where standalone functions can be tests. It also provides parametric test support that is vastly easier to use than nose’s for debugging, because if a test fails, the stack under inspection is that of the test and not that of the test framework.

  • An @as_unittest decorator can be used to tag any normal parameter-less function as a unittest TestCase. Then, both nose and normal unittest will recognize it as such.

Authors

nipy.io.imageformats.testing.lightunit.as_unittest(func)

Decorator to make a simple function into a normal test via unittest.