diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-06 20:15:51 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-06 20:15:51 +0100 |
| commit | 596ee7f64662dd94f1a21967f15d451bad969a2e (patch) | |
| tree | fd381aef995c515d46b5ec8031e9b9d277225474 /test_joblib.py | |
| parent | 4a8262f5cd9d319817ae7bf7ee69fc587808b0ad (diff) | |
| download | joblib-596ee7f64662dd94f1a21967f15d451bad969a2e.tar.gz joblib-596ee7f64662dd94f1a21967f15d451bad969a2e.zip | |
support acquiring in batches
Diffstat (limited to 'test_joblib.py')
| -rw-r--r-- | test_joblib.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test_joblib.py b/test_joblib.py index 1a760f8..fc9640b 100644 --- a/test_joblib.py +++ b/test_joblib.py @@ -59,6 +59,15 @@ class TestJoblib: assert None == (await queue.acquire(jobtype="testing"))[1] @pytest.mark.asyncio + async def test_request_and_acquire_batch_batched(self, queue, payload): + # request should succeed + await queue.request(jobtype="testing", payload=[payload]*5) + # acquire should return same payload + assert payload == (await queue.acquire(jobtype="testing", length=5))[0][1] + # there should not be another job + assert None == (await queue.acquire(jobtype="testing"))[1] + + @pytest.mark.asyncio async def test_cleanup(self, queue, payload): await queue.request(jobtype="testing", payload=payload) # mark job as processing |
