Docstring should not be included with detail_level=1 if source is found
()
| 460 | |
| 461 | |
| 462 | def 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 | |
| 478 | def test_pinfo_docstring_if_detail_and_no_source(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…