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

Method __getattr__

src/_pytest/_py/error.py:60–66  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

58 _errno2class: dict[int, type[Error]] = {}
59
60 def __getattr__(self, name: str) -> type[Error]:
61 if name[0] == "_":
62 raise AttributeError(name)
63 eno = getattr(errno, name)
64 cls = self._geterrnoclass(eno)
65 setattr(self, name, cls)
66 return cls
67
68 def _geterrnoclass(self, eno: int) -> type[Error]:
69 try:

Callers

nothing calls this directly

Calls 1

_geterrnoclassMethod · 0.95

Tested by

no test coverage detected