MCPcopy Create free account
hub / github.com/pytest-dev/pytest / notify_exception

Method notify_exception

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

Source from the content-addressed store, hash-verified

1033 return self
1034
1035 def notify_exception(
1036 self,
1037 excinfo: ExceptionInfo[BaseException],
1038 option: Optional[argparse.Namespace] = None,
1039 ) -> None:
1040 if option and getattr(option, "fulltrace", False):
1041 style: _TracebackStyle = "long"
1042 else:
1043 style = "native"
1044 excrepr = excinfo.getrepr(
1045 funcargs=True, showlocals=getattr(option, "showlocals", False), style=style
1046 )
1047 res = self.hook.pytest_internalerror(excrepr=excrepr, excinfo=excinfo)
1048 if not any(res):
1049 for line in str(excrepr).split("\n"):
1050 sys.stderr.write("INTERNALERROR> %s\n" % line)
1051 sys.stderr.flush()
1052
1053 def cwd_relative_nodeid(self, nodeid: str) -> str:
1054 # 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