MCPcopy Index your code
hub / github.com/ipython/ipython / test_pinfo_no_docstring_if_source

Function test_pinfo_no_docstring_if_source

tests/test_oinspect.py:462–475  ·  view source on GitHub ↗

Docstring should not be included with detail_level=1 if source is found

()

Source from the content-addressed store, hash-verified

460
461
462def test_pinfo_no_docstring_if_source():
463 """Docstring should not be included with detail_level=1 if source is found"""
464
465 def foo():
466 """foo has a docstring"""
467
468 ip.user_ns["foo"] = foo
469
470 with AssertPrints("Docstring:"):
471 ip._inspect("pinfo", "foo", detail_level=0)
472 with AssertPrints("Source:"):
473 ip._inspect("pinfo", "foo", detail_level=1)
474 with AssertNotPrints("Docstring:"):
475 ip._inspect("pinfo", "foo", detail_level=1)
476
477
478def test_pinfo_docstring_if_detail_and_no_source():

Callers

nothing calls this directly

Calls 3

AssertPrintsClass · 0.90
AssertNotPrintsClass · 0.90
_inspectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…