(self)
| 110 | self._recent_pos = fd.tell() |
| 111 | |
| 112 | def get_missed(self) -> Tuple[List[str], List[str]]: |
| 113 | errors = [] |
| 114 | warnings = [] |
| 115 | self._recent_errors = [] |
| 116 | self._recent_warnings = [] |
| 117 | if os.path.isfile(self._path): |
| 118 | with open(self._path) as fd: |
| 119 | fd.seek(self._start_pos, os.SEEK_SET) |
| 120 | for line in fd: |
| 121 | if self._is_ignored(line): |
| 122 | continue |
| 123 | if line in self._caught_matches: |
| 124 | continue |
| 125 | m = self.RE_ERRLOG_WARN.match(line) |
| 126 | if m and line not in self._caught_warnings: |
| 127 | warnings.append(line) |
| 128 | continue |
| 129 | m = self.RE_ERRLOG_ERROR.match(line) |
| 130 | if m and line not in self._caught_errors: |
| 131 | errors.append(line) |
| 132 | continue |
| 133 | self._start_pos = self._recent_pos = fd.tell() |
| 134 | self._caught_errors = set() |
| 135 | self._caught_warnings = set() |
| 136 | self._caught_matches = set() |
| 137 | return errors, warnings |
| 138 | |
| 139 | def scan_recent(self, pattern: re.Pattern, timeout=10): |
| 140 | if not os.path.isfile(self.path): |
no test coverage detected