Show More
@@ -134,3 +134,19 b' def test_info():' | |||||
134 | i = inspector.info(OldStyle()) |
|
134 | i = inspector.info(OldStyle()) | |
135 | nt.assert_equal(i['type_name'], 'instance') |
|
135 | nt.assert_equal(i['type_name'], 'instance') | |
136 | nt.assert_equal(i['docstring'], OldStyle.__doc__) |
|
136 | nt.assert_equal(i['docstring'], OldStyle.__doc__) | |
|
137 | ||||
|
138 | def test_getdoc(): | |||
|
139 | class A(object): | |||
|
140 | """standard docstring""" | |||
|
141 | pass | |||
|
142 | ||||
|
143 | class B(object): | |||
|
144 | """standard docstring""" | |||
|
145 | def getdoc(self): | |||
|
146 | return "custom docstring" | |||
|
147 | ||||
|
148 | a = A() | |||
|
149 | b = B() | |||
|
150 | ||||
|
151 | nt.assert_equal(oinspect.getdoc(a), "standard docstring") | |||
|
152 | nt.assert_equal(oinspect.getdoc(b), "custom docstring") |
General Comments 0
You need to be logged in to leave comments.
Login now