MCPcopy
hub / github.com/pytest-dev/pytest / annotated_getattr

Function annotated_getattr

src/_pytest/monkeypatch.py:93–100  ·  view source on GitHub ↗
(obj: object, name: str, ann: str)

Source from the content-addressed store, hash-verified

91
92
93def annotated_getattr(obj: object, name: str, ann: str) -> object:
94 try:
95 obj = getattr(obj, name)
96 except AttributeError as e:
97 raise AttributeError(
98 f"{type(obj).__name__!r} object at {ann} has no attribute {name!r}"
99 ) from e
100 return obj
101
102
103def derive_importpath(import_path: str, raising: bool) -> tuple[str, object]:

Callers 2

resolveFunction · 0.85
derive_importpathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected