Example #1
0
    def test_async_apply(self, adapter_pool: AdapterPool):
        TestSimplePool._initial()
        adapter_pool.initial()
        adapter_pool.async_apply(tasks_size=Task_Size,
                                 function=target_function)
        TestSimplePool._chk_record()

        _results = adapter_pool.get_result()
        TestSimplePool.chk_results(results=_results, expected_size=Task_Size)
Example #2
0
 def test_close(self, adapter_pool: AdapterPool):
     try:
         adapter_pool.initial()
         adapter_pool.async_apply(tasks_size=Task_Size,
                                  function=lambda a: a + a,
                                  args=(1, ))
         adapter_pool.close()
     except Exception:
         assert False, f"It should work finely without any issue. Please check it.\n Error: {traceback.format_exc()}"
     else:
         assert True, "It work finely without any issue."