Show More
@@ -114,11 +114,12 b' def test_skip_dt_decorator():' | |||
|
114 | 114 | # Fetch the docstring from doctest_bad after decoration. |
|
115 | 115 | val = doctest_bad.__doc__ |
|
116 | 116 | |
|
117 |
assert |
|
|
117 | nt.assert_equal(check,val,"doctest_bad docstrings don't match") | |
|
118 | ||
|
118 | 119 | |
|
119 | 120 | # Doctest skipping should work for class methods too |
|
120 |
class |
|
|
121 | """Foo | |
|
121 | class FooClass(object): | |
|
122 | """FooClass | |
|
122 | 123 | |
|
123 | 124 | Example: |
|
124 | 125 | |
@@ -128,22 +129,22 b' class foo(object):' | |||
|
128 | 129 | |
|
129 | 130 | @dec.skip_doctest |
|
130 | 131 | def __init__(self,x): |
|
131 |
"""Make a |
|
|
132 | """Make a FooClass. | |
|
132 | 133 | |
|
133 | 134 | Example: |
|
134 | 135 | |
|
135 |
>>> f = |
|
|
136 | >>> f = FooClass(3) | |
|
136 | 137 | junk |
|
137 | 138 | """ |
|
138 |
print 'Making a |
|
|
139 | print 'Making a FooClass.' | |
|
139 | 140 | self.x = x |
|
140 | 141 | |
|
141 | 142 | @dec.skip_doctest |
|
142 | 143 | def bar(self,y): |
|
143 | 144 | """Example: |
|
144 | 145 | |
|
145 |
>>> f |
|
|
146 | >>> f.bar(0) | |
|
146 | >>> ff = FooClass(3) | |
|
147 | >>> ff.bar(0) | |
|
147 | 148 | boom! |
|
148 | 149 | >>> 1/0 |
|
149 | 150 | bam! |
@@ -153,15 +154,14 b' class foo(object):' | |||
|
153 | 154 | def baz(self,y): |
|
154 | 155 | """Example: |
|
155 | 156 | |
|
156 |
>>> f |
|
|
157 |
Making a |
|
|
158 | >>> f.baz(3) | |
|
157 | >>> ff2 = FooClass(3) | |
|
158 | Making a FooClass. | |
|
159 | >>> ff2.baz(3) | |
|
159 | 160 | True |
|
160 | 161 | """ |
|
161 | 162 | return self.x==y |
|
162 | 163 | |
|
163 | 164 | |
|
164 | ||
|
165 | 165 | def test_skip_dt_decorator2(): |
|
166 | 166 | """Doctest-skipping decorator should preserve function signature. |
|
167 | 167 | """ |
General Comments 0
You need to be logged in to leave comments.
Login now