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

Method notify_exception

src/_pytest/config/__init__.py:1255–1271  ·  view source on GitHub ↗
(
        self,
        excinfo: ExceptionInfo[BaseException],
        option: argparse.Namespace | None = None,
    )

Source from the content-addressed store, hash-verified

1253 return self
1254
1255 def notify_exception(
1256 self,
1257 excinfo: ExceptionInfo[BaseException],
1258 option: argparse.Namespace | None = None,
1259 ) -> None:
1260 if option and getattr(option, "fulltrace", False):
1261 style: TracebackStyle = "long"
1262 else:
1263 style = "native"
1264 excrepr = excinfo.getrepr(
1265 funcargs=True, showlocals=getattr(option, "showlocals", False), style=style
1266 )
1267 res = self.hook.pytest_internalerror(excrepr=excrepr, excinfo=excinfo)
1268 if not any(res):
1269 for line in str(excrepr).split("\n"):
1270 sys.stderr.write(f"INTERNALERROR> {line}\n")
1271 sys.stderr.flush()
1272
1273 def cwd_relative_nodeid(self, nodeid: str) -> str:
1274 # nodeid's are relative to the rootpath, compute relative to cwd.

Callers 2

wrap_sessionFunction · 0.80
test_notify_exceptionFunction · 0.80

Calls 4

getreprMethod · 0.80
pytest_internalerrorMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45

Tested by 1

test_notify_exceptionFunction · 0.64