MCPcopy Create free account
hub / github.com/ipython/ipython / test_getdoc

Function test_getdoc

IPython/core/tests/test_oinspect.py:237–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235 nt.assert_equal(i['definition'], "f_kwarg(pos, *, kwonly)")
236
237def test_getdoc():
238 class A(object):
239 """standard docstring"""
240 pass
241
242 class B(object):
243 """standard docstring"""
244 def getdoc(self):
245 return "custom docstring"
246
247 class C(object):
248 """standard docstring"""
249 def getdoc(self):
250 return None
251
252 a = A()
253 b = B()
254 c = C()
255
256 nt.assert_equal(oinspect.getdoc(a), "standard docstring")
257 nt.assert_equal(oinspect.getdoc(b), "custom docstring")
258 nt.assert_equal(oinspect.getdoc(c), "standard docstring")
259
260
261def test_empty_property_has_no_source():

Callers

nothing calls this directly

Calls 4

AClass · 0.70
BClass · 0.70
CClass · 0.70
getdocMethod · 0.45

Tested by

no test coverage detected