Format: application/x-python-code
1 o
2
3 ��h� � @ s~ d Z ddlZddlZddlZddlZddlZddlmZ ddlmZ ddl m
4 Z
5 mZ dd� Zd*d d
6 �Z
7 d*dd�Zd
8 d� Zdd� Ze
9 ejdkd�Ze
10 ej�d�d�Ze
11 ejdkd�Ze
12 ejdkd�Ze
13 ej�d� d�Ze
14 ej�d� d�Zejdvo�ej�dd�dkZdZe
15 ee�Zdd� Zed �Zed!�Z d"d� Z!zej"d#d$�Z#W n e$y� d%Z%Y nw d&Z%e#�&� ee%d'�Z'd(d)� Z(dS )+a Decorators for labeling test objects.
16
17 Decorators that merely return a modified version of the original function
18 object are straightforward. Decorators that return a new function object need
19 to use nose.tools.make_decorator(original_function)(decorator) in returning the
20 decorator, in order to preserve metadata such as function name, setup and
21 teardown functions and so on - see nose.tools for more information.
22
23 This module provides a set of useful decorators meant to be ready to use in
24 your own tests. See the bottom of the file for the ready-made ones, and if you
25 find yourself writing a new one that may be of generic use, add it here.
26
27 Included decorators:
28
29
30 Lightweight testing that remains unittest-compatible.
31
32 - An @as_unittest decorator can be used to tag any normal parameter-less
33 function as a unittest TestCase. Then, both nose and normal unittest will
34 recognize it as such. This will make it easier to migrate away from Nose if
35 we ever need/want to while maintaining very lightweight tests.
36
37 NOTE: This file contains IPython-specific decorators. Using the machinery in
38 IPython.external.decorators, we import either numpy.testing.decorators if numpy is
39 available, OR use equivalent code in IPython.external._decorators, which
40 we've copied verbatim from numpy.
41
42 � N)�
43 import_module)� decorator� )� ipdoctest�ipdocstringc s"