(self, start_method)
| 139 | |
| 140 | @params(*start_methods) |
| 141 | def test_pool_multi_task(self, start_method): |
| 142 | groups = [MockGroup.from_callback(simple_callback)] |
| 143 | with create_pool( |
| 144 | groups, keep_alive_queue_size=1, num_workers=1, start_method=start_method |
| 145 | ) as pool: |
| 146 | pids = get_pids(pool) |
| 147 | pid = pids[0] |
| 148 | tasks = [(SampleInfo(i, i, 0, 0),) for i in range(10)] |
| 149 | work_batch = TaskArgs.make_sample(SampleRange(0, 10, 0, 0)) |
| 150 | pool.schedule_batch(context_i=0, work_batch=work_batch) |
| 151 | batch = pool.receive_batch(context_i=0) |
| 152 | for task, sample in zip(tasks, batch): |
| 153 | np.testing.assert_array_equal(answer(pid, *task), sample) |
| 154 | |
| 155 | # Test that we can safely hold as many results as the keep_alive_queue_size |
| 156 | @params(*start_methods) |
nothing calls this directly
no test coverage detected