(self, delta)
| 141 | |
| 142 | @contextlib.contextmanager |
| 143 | def assertRunUnder(self, delta): |
| 144 | st = time.monotonic() |
| 145 | try: |
| 146 | yield |
| 147 | finally: |
| 148 | elapsed = time.monotonic() - st |
| 149 | if elapsed > delta: |
| 150 | raise AssertionError( |
| 151 | 'running block took {:0.3f}s which is longer ' |
| 152 | 'than the expected maximum of {:0.3f}s'.format( |
| 153 | elapsed, delta)) |
| 154 | |
| 155 | @contextlib.contextmanager |
| 156 | def assertLoopErrorHandlerCalled(self, msg_re: str): |
no outgoing calls