(self, entries: Sequence[tuple[str, str]])
| 283 | return [call for call in self.calls if call._name in names] |
| 284 | |
| 285 | def assert_contains(self, entries: Sequence[tuple[str, str]]) -> None: |
| 286 | __tracebackhide__ = True |
| 287 | i = 0 |
| 288 | entries = list(entries) |
| 289 | # Since Python 3.13, f_locals is not a dict, but eval requires a dict. |
| 290 | backlocals = dict(sys._getframe(1).f_locals) |
| 291 | while entries: |
| 292 | name, check = entries.pop(0) |
| 293 | for ind, call in enumerate(self.calls[i:]): |
| 294 | if call._name == name: |
| 295 | print("NAMEMATCH", name, call) |
| 296 | if eval(check, backlocals, call.__dict__): |
| 297 | print("CHECKERMATCH", repr(check), "->", call) |
| 298 | else: |
| 299 | print("NOCHECKERMATCH", repr(check), "-", call) |
| 300 | continue |
| 301 | i += ind + 1 |
| 302 | break |
| 303 | print("NONAMEMATCH", name, "with", call) |
| 304 | else: |
| 305 | fail(f"could not find {name!r} check {check!r}") |
| 306 | |
| 307 | def popcall(self, name: str) -> RecordedHookCall: |
| 308 | __tracebackhide__ = True |
no test coverage detected