Show More
@@ -120,8 +120,7 b" skip_doctest = make_label_dec('skip_doctest'," | |||
|
120 | 120 | omit from testing, while preserving the docstring for introspection, help, |
|
121 | 121 | etc.""") |
|
122 | 122 | |
|
123 | ||
|
124 | def skip(func,msg=''): | |
|
123 | def skip(msg=''): | |
|
125 | 124 | """Decorator - mark a test function for skipping from test suite. |
|
126 | 125 | |
|
127 | 126 | :Parameters: |
@@ -135,6 +134,8 b" def skip(func,msg=''):" | |||
|
135 | 134 | |
|
136 | 135 | import nose |
|
137 | 136 | |
|
137 | def inner(func): | |
|
138 | ||
|
138 | 139 | def wrapper(*a,**k): |
|
139 | 140 | if msg: out = '\n'+msg |
|
140 | 141 | else: out = '' |
@@ -143,4 +144,4 b" def skip(func,msg=''):" | |||
|
143 | 144 | |
|
144 | 145 | return apply_wrapper(wrapper,func) |
|
145 | 146 | |
|
146 | ||
|
147 | return inner |
@@ -45,6 +45,11 b' def test_deliberately_broken():' | |||
|
45 | 45 | """A deliberately broken test - we want to skip this one.""" |
|
46 | 46 | 1/0 |
|
47 | 47 | |
|
48 | @dec.skip('foo') | |
|
49 | def test_deliberately_broken2(): | |
|
50 | """Another deliberately broken test - we want to skip this one.""" | |
|
51 | 1/0 | |
|
52 | ||
|
48 | 53 | |
|
49 | 54 | # Verify that we can correctly skip the doctest for a function at will, but |
|
50 | 55 | # that the docstring itself is NOT destroyed by the decorator. |
General Comments 0
You need to be logged in to leave comments.
Login now