(*args, **kwargs)
| 462 | state = {'n': 0} |
| 463 | |
| 464 | def flaky(*args, **kwargs): |
| 465 | state['n'] += 1 |
| 466 | if state['n'] == 1: |
| 467 | raise OSError('simulated broker restart') |
| 468 | # Yield to hub so the promise thread can run. |
| 469 | self.result_consumer_drain_events( |
| 470 | timeout=kwargs.get('timeout', None), |
| 471 | ) |
| 472 | |
| 473 | with patch.object( |
| 474 | self.drainer.result_consumer, 'drain_events', |
no test coverage detected