Skip to content

Commit bc976dc

Browse files
authored
pytester: add __tracebackhide__ for matching randomly (#6746)
1 parent 7b8968f commit bc976dc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/_pytest/pytester.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,16 +1334,19 @@ def _getlines(self, lines2: Union[str, Sequence[str], Source]) -> Sequence[str]:
13341334
def fnmatch_lines_random(self, lines2: Sequence[str]) -> None:
13351335
"""Check lines exist in the output in any order (using :func:`python:fnmatch.fnmatch`).
13361336
"""
1337+
__tracebackhide__ = True
13371338
self._match_lines_random(lines2, fnmatch)
13381339

13391340
def re_match_lines_random(self, lines2: Sequence[str]) -> None:
13401341
"""Check lines exist in the output in any order (using :func:`python:re.match`).
13411342
"""
1343+
__tracebackhide__ = True
13421344
self._match_lines_random(lines2, lambda name, pat: bool(re.match(pat, name)))
13431345

13441346
def _match_lines_random(
13451347
self, lines2: Sequence[str], match_func: Callable[[str, str], bool]
13461348
) -> None:
1349+
__tracebackhide__ = True
13471350
lines2 = self._getlines(lines2)
13481351
for line in lines2:
13491352
for x in self.lines:

0 commit comments

Comments
 (0)