MCPcopy
hub / github.com/pytest-dev/pytest / repr_failure

Method repr_failure

doc/en/example/nonpython/conftest.py:33–43  ·  view source on GitHub ↗

Called when self.runtest() raises an exception.

(self, excinfo)

Source from the content-addressed store, hash-verified

31 raise YamlException(self, name, value)
32
33 def repr_failure(self, excinfo):
34 """Called when self.runtest() raises an exception."""
35 if isinstance(excinfo.value, YamlException):
36 return "\n".join(
37 [
38 "usecase execution failed",
39 " spec failed: {1!r}: {2!r}".format(*excinfo.value.args),
40 " no further details known at this point.",
41 ]
42 )
43 return super().repr_failure(excinfo)
44
45 def reportinfo(self):
46 return self.path, 0, f"usecase: {self.name}"

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected