Pop the first recorded warning, raise exception if not exists.
(self, cls: Type[Warning] = Warning)
| 186 | return len(self._list) |
| 187 | |
| 188 | def pop(self, cls: Type[Warning] = Warning) -> "warnings.WarningMessage": |
| 189 | """Pop the first recorded warning, raise exception if not exists.""" |
| 190 | for i, w in enumerate(self._list): |
| 191 | if issubclass(w.category, cls): |
| 192 | return self._list.pop(i) |
| 193 | __tracebackhide__ = True |
| 194 | raise AssertionError("%r not found in warning list" % cls) |
| 195 | |
| 196 | def clear(self) -> None: |
| 197 | """Clear the list of recorded warnings.""" |
no outgoing calls