Wait 0.05 second and return a + b.
(self, a, b, fail=False, cancel=False)
| 3591 | self.set_event_loop(self.loop) # Will cleanup properly |
| 3592 | |
| 3593 | async def add(self, a, b, fail=False, cancel=False): |
| 3594 | """Wait 0.05 second and return a + b.""" |
| 3595 | await asyncio.sleep(0.05) |
| 3596 | if fail: |
| 3597 | raise RuntimeError("Fail!") |
| 3598 | if cancel: |
| 3599 | asyncio.current_task(self.loop).cancel() |
| 3600 | await asyncio.sleep(0) |
| 3601 | return a + b |
| 3602 | |
| 3603 | def target(self, fail=False, cancel=False, timeout=None, |
| 3604 | advance_coro=False): |
no test coverage detected