diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index bacb1c23d..f44a69a95 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1481,6 +1481,7 @@ class LineMatcher: self._log_output = [] def _fail(self, msg): + __tracebackhide__ = True log_text = self._log_text self._log_output = [] pytest.fail(log_text)