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

Function test_pinfo_bool_raise

tests/test_oinspect.py:383–397  ·  view source on GitHub ↗

Test that bool method is not called on parent.

()

Source from the content-addressed store, hash-verified

381
382
383def 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
400def test_pinfo_getindex():

Callers

nothing calls this directly

Calls 3

RaiseBoolClass · 0.85
cleanup_user_nsFunction · 0.85
_inspectMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…