Skip to content

Commit ac0a967

Browse files
committed
pytester: fix __tracebackhide__ for {re_,fn}match_lines
1 parent b895816 commit ac0a967

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/pytester.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,7 @@ def fnmatch_lines(self, lines2):
13231323
matches and non-matches are also printed on stdout.
13241324
13251325
"""
1326+
__tracebackhide__ = True
13261327
self._match_lines(lines2, fnmatch, "fnmatch")
13271328

13281329
def re_match_lines(self, lines2):
@@ -1334,6 +1335,7 @@ def re_match_lines(self, lines2):
13341335
The matches and non-matches are also printed on stdout.
13351336
13361337
"""
1338+
__tracebackhide__ = True
13371339
self._match_lines(lines2, lambda name, pat: re.match(pat, name), "re.match")
13381340

13391341
def _match_lines(self, lines2, match_func, match_nickname):
@@ -1352,7 +1354,6 @@ def _match_lines(self, lines2, match_func, match_nickname):
13521354
lines1 = self.lines[:]
13531355
nextline = None
13541356
extralines = []
1355-
__tracebackhide__ = True
13561357
for line in lines2:
13571358
nomatchprinted = False
13581359
while lines1:

0 commit comments

Comments
 (0)