@@ -217,7 +217,7 @@ def relline(self) -> int:
217217 return self .lineno - self .frame .code .firstlineno
218218
219219 def __repr__ (self ) -> str :
220- return f"<TracebackEntry { self .frame .code .path } :{ self .lineno + 1 } >"
220+ return f"<TracebackEntry { self .frame .code .path } :{ self .lineno + 1 } >"
221221
222222 @property
223223 def statement (self ) -> Source :
@@ -303,7 +303,7 @@ def __str__(self) -> str:
303303 # This output does not quite match Python's repr for traceback entries,
304304 # but changing it to do so would break certain plugins. See
305305 # https://github.com/pytest-dev/pytest/pull/7535/ for details.
306- return f" File '{ self .path } ':{ self .lineno + 1 } in { name } \n { line } \n "
306+ return f" File '{ self .path } ':{ self .lineno + 1 } in { name } \n { line } \n "
307307
308308 @property
309309 def name (self ) -> str :
@@ -527,33 +527,33 @@ def fill_unfilled(self, exc_info: tuple[type[E], E, TracebackType]) -> None:
527527 @property
528528 def type (self ) -> type [E ]:
529529 """The exception class."""
530- assert (
531- self . _excinfo is not None
532- ), ".type can only be used after the context manager exits"
530+ assert self . _excinfo is not None , (
531+ ".type can only be used after the context manager exits"
532+ )
533533 return self ._excinfo [0 ]
534534
535535 @property
536536 def value (self ) -> E :
537537 """The exception value."""
538- assert (
539- self . _excinfo is not None
540- ), ".value can only be used after the context manager exits"
538+ assert self . _excinfo is not None , (
539+ ".value can only be used after the context manager exits"
540+ )
541541 return self ._excinfo [1 ]
542542
543543 @property
544544 def tb (self ) -> TracebackType :
545545 """The exception raw traceback."""
546- assert (
547- self . _excinfo is not None
548- ), ".tb can only be used after the context manager exits"
546+ assert self . _excinfo is not None , (
547+ ".tb can only be used after the context manager exits"
548+ )
549549 return self ._excinfo [2 ]
550550
551551 @property
552552 def typename (self ) -> str :
553553 """The type name of the exception."""
554- assert (
555- self . _excinfo is not None
556- ), ".typename can only be used after the context manager exits"
554+ assert self . _excinfo is not None , (
555+ ".typename can only be used after the context manager exits"
556+ )
557557 return self .type .__name__
558558
559559 @property
0 commit comments