Test that bool method is not called on parent.
()
| 381 | |
| 382 | |
| 383 | def test_pinfo_bool_raise(): |
| 384 | """ |
| 385 | Test that bool method is not called on parent. |
| 386 | """ |
| 387 | |
| 388 | class RaiseBool: |
| 389 | attr = None |
| 390 | |
| 391 | def __bool__(self): |
| 392 | raise ValueError("pinfo should not access this method") |
| 393 | |
| 394 | raise_bool = RaiseBool() |
| 395 | |
| 396 | with cleanup_user_ns(raise_bool=raise_bool): |
| 397 | ip._inspect("pinfo", "raise_bool.attr", detail_level=0) |
| 398 | |
| 399 | |
| 400 | def test_pinfo_getindex(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…