From 96ef7d678b43d6f35624def3a3a610efe5f731df Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Sat, 13 Mar 2021 11:11:41 +0200 Subject: [PATCH] code: fix outdated reference in ExceptionInfo.exconly docstring No such thing as `_pytest._code.AssertionError`, it's just the built-in `AssertionError`. --- src/_pytest/_code/code.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/_pytest/_code/code.py b/src/_pytest/_code/code.py index 8345c4d79..610f4e68d 100644 --- a/src/_pytest/_code/code.py +++ b/src/_pytest/_code/code.py @@ -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)