After a test case triggered errors/warnings on purpose, add those to our 'caught' list so the do not get reported as 'missed'.
(self, lognos: List[str] = [], matches: List[str] = [])
| 84 | return False |
| 85 | |
| 86 | def ignore_recent(self, lognos: List[str] = [], matches: List[str] = []): |
| 87 | """After a test case triggered errors/warnings on purpose, add |
| 88 | those to our 'caught' list so the do not get reported as 'missed'. |
| 89 | """ |
| 90 | self._recent_errors = [] |
| 91 | self._recent_warnings = [] |
| 92 | if os.path.isfile(self._path): |
| 93 | with open(self._path) as fd: |
| 94 | fd.seek(self._recent_pos, os.SEEK_SET) |
| 95 | lognos_set = set(lognos) |
| 96 | for line in fd: |
| 97 | if self._is_ignored(line): |
| 98 | continue |
| 99 | if self._lookup_matches(line, matches): |
| 100 | self._caught_matches.add(line) |
| 101 | continue |
| 102 | m = self.RE_ERRLOG_WARN.match(line) |
| 103 | if m and self._lookup_lognos(line, lognos_set): |
| 104 | self._caught_warnings.add(line) |
| 105 | continue |
| 106 | m = self.RE_ERRLOG_ERROR.match(line) |
| 107 | if m and self._lookup_lognos(line, lognos_set): |
| 108 | self._caught_errors.add(line) |
| 109 | continue |
| 110 | self._recent_pos = fd.tell() |
| 111 | |
| 112 | def get_missed(self) -> Tuple[List[str], List[str]]: |
| 113 | errors = [] |