Book Image

NumPy: Beginner's Guide

By : Ivan Idris
Book Image

NumPy: Beginner's Guide

By: Ivan Idris

Overview of this book

Table of Contents (21 chapters)
NumPy Beginner's Guide Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
NumPy Functions' References
Index

Nose test decorators


A nose is an organ above the mouth that is used by humans and animals to breathe and smell. It is also a Python framework that makes (unit) testing easier. Nose helps you organize tests. According to the nose documentation:

"Any python source file, directory or package that matches the testMatch regular expression (by default: (?:^|[b_.-])[Tt]est) will be collected as a test."

Nose makes extensive use of decorators. Python decorators are annotations that indicate something about a method or a function (see http://thecodeship.com/patterns/guide-to-python-function-decorators/). The numpy.testing module has a number of decorators. The following table shows the different decorators in the numpy.testing module:

Decorator

Description

numpy.testing.decorators.deprecated

This function filters deprecation warnings when running tests

numpy.testing.decorators.knownfailureif

This function raises KnownFailureTest exception based on a condition

numpy.testing.decorators.setastest...