| 55 | |
| 56 | |
| 57 | class Spy: |
| 58 | def __init__(self): |
| 59 | self.count = 0 |
| 60 | self.calls = {} |
| 61 | |
| 62 | def __repr__(self): |
| 63 | return f'Spy(count={self.count!r}, calls={self.calls!r})' |
| 64 | |
| 65 | def register_call(self, called_args, called_kwargs, **kwargs): |
| 66 | self.calls[self.count] = CallCtxt(called_args, called_kwargs, **kwargs) |
| 67 | self.count += 1 |
| 68 | |
| 69 | |
| 70 | @pytest.fixture |