def typename(self) -> str:
        """The type name of the exception."""
        assert self._excinfo is not None, (
            ".typename can only be used after the context manager exits"
        )
        return self.type.__name__
The type name of the exception.
src/_pytest/_code/code.py