Fixes #7077: Added & improved docs for repr_failure() in Node & Collector

This commit is contained in:
Andreas Maier 2020-04-12 09:25:54 +02:00
parent f214a4be97
commit 869c089887
1 changed files with 14 additions and 1 deletions

View File

@ -364,6 +364,14 @@ class Node(metaclass=NodeMeta):
def repr_failure(
self, excinfo, style=None
) -> Union[str, ReprExceptionInfo, ExceptionChainRepr, FixtureLookupErrorRepr]:
"""
Return a string representation of a collection failure.
:param excinfo: Exception information for the failure as a tuple
(type, value, traceback), see sys.exc_info().
:param style: Style of the representation ('long', 'short', 'auto',
None).
"""
return self._repr_failure_py(excinfo, style)
@ -403,7 +411,12 @@ class Collector(Node):
raise NotImplementedError("abstract")
def repr_failure(self, excinfo):
""" represent a collection failure. """
"""
Return a string representation of a collection failure.
:param excinfo: Exception information for the failure as a tuple
(type, value, traceback), see sys.exc_info().
"""
if excinfo.errisinstance(self.CollectError) and not self.config.getoption(
"fulltrace", False
):