code: fix outdated reference in ExceptionInfo.exconly docstring

No such thing as `_pytest._code.AssertionError`, it's just the built-in
`AssertionError`.
This commit is contained in:
Ran Benita 2021-03-13 11:11:41 +02:00
parent 5bbfb4e058
commit 96ef7d678b
1 changed files with 4 additions and 4 deletions

View File

@ -562,10 +562,10 @@ class ExceptionInfo(Generic[E]):
def exconly(self, tryshort: bool = False) -> str:
"""Return the exception as a string.
When 'tryshort' resolves to True, and the exception is a
_pytest._code._AssertionError, only the actual exception part of
the exception representation is returned (so 'AssertionError: ' is
removed from the beginning).
When 'tryshort' resolves to True, and the exception is an
AssertionError, only the actual exception part of the exception
representation is returned (so 'AssertionError: ' is removed from
the beginning).
"""
lines = format_exception_only(self.type, self.value)
text = "".join(lines)