diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py index bacb1c23d6d..f44a69a951c 100644 --- a/src/_pytest/pytester.py +++ b/src/_pytest/pytester.py @@ -1481,6 +1481,7 @@ def _no_match_line(self, pat, match_func, match_nickname): self._log_output = [] def _fail(self, msg): + __tracebackhide__ = True log_text = self._log_text self._log_output = [] pytest.fail(log_text)