(loop)
| 528 | class TestCase(unittest.TestCase): |
| 529 | @staticmethod |
| 530 | def close_loop(loop): |
| 531 | if loop._default_executor is not None: |
| 532 | if not loop.is_closed(): |
| 533 | loop.run_until_complete(loop.shutdown_default_executor()) |
| 534 | else: |
| 535 | loop._default_executor.shutdown(wait=True) |
| 536 | loop.close() |
| 537 | |
| 538 | def set_event_loop(self, loop, *, cleanup=True): |
| 539 | if loop is None: |