| 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. |