(self, rawexcinfo: "_SysExcInfoType")
| 205 | pass |
| 206 | |
| 207 | def _addexcinfo(self, rawexcinfo: "_SysExcInfoType") -> None: |
| 208 | # Unwrap potential exception info (see twisted trial support below). |
| 209 | rawexcinfo = getattr(rawexcinfo, "_rawexcinfo", rawexcinfo) |
| 210 | try: |
| 211 | excinfo = _pytest._code.ExceptionInfo[BaseException].from_exc_info(rawexcinfo) # type: ignore[arg-type] |
| 212 | # Invoke the attributes to trigger storing the traceback |
| 213 | # trial causes some issue there. |
| 214 | excinfo.value |
| 215 | excinfo.traceback |
| 216 | except TypeError: |
| 217 | try: |
| 218 | try: |
| 219 | values = traceback.format_exception(*rawexcinfo) |
| 220 | values.insert( |
| 221 | 0, |
| 222 | "NOTE: Incompatible Exception Representation, " |
| 223 | "displaying natively:\n\n", |
| 224 | ) |
| 225 | fail("".join(values), pytrace=False) |
| 226 | except (fail.Exception, KeyboardInterrupt): |
| 227 | raise |
| 228 | except BaseException: |
| 229 | fail( |
| 230 | "ERROR: Unknown Incompatible Exception " |
| 231 | "representation:\n%r" % (rawexcinfo,), |
| 232 | pytrace=False, |
| 233 | ) |
| 234 | except KeyboardInterrupt: |
| 235 | raise |
| 236 | except fail.Exception: |
| 237 | excinfo = _pytest._code.ExceptionInfo.from_current() |
| 238 | self.__dict__.setdefault("_excinfo", []).append(excinfo) |
| 239 | |
| 240 | def addError( |
| 241 | self, testcase: "unittest.TestCase", rawexcinfo: "_SysExcInfoType" |
no test coverage detected