pytester: LineMatcher: use `_fail` with `_match_lines_random` (#6747)

This commit is contained in:
Daniel Hahler 2020-02-19 13:16:57 +01:00 committed by GitHub
parent f95c7f5803
commit 4021770688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1354,8 +1354,9 @@ class LineMatcher:
self._log("matched: ", repr(line))
break
else:
self._log("line %r not found in output" % line)
raise ValueError(self._log_text)
msg = "line %r not found in output" % line
self._log(msg)
self._fail(msg)
def get_lines_after(self, fnline: str) -> Sequence[str]:
"""Return all lines following the given line in the text.