summaryrefslogtreecommitdiff
path: root/test_joblib.py
diff options
context:
space:
mode:
authorschneefux <schneefux+github@schneefux.xyz>2017-03-05 10:36:14 +0100
committerGitHub <noreply@github.com>2017-03-05 10:36:14 +0100
commit3229571141b638d9d5d6985e98b7e61642229b77 (patch)
treefbddd8932dac8b169ddbf07e31634db31a5c7899 /test_joblib.py
parent8d58a4f5f754b6541af84478a2df3fba70db94be (diff)
downloadjoblib-3229571141b638d9d5d6985e98b7e61642229b77.tar.gz
joblib-3229571141b638d9d5d6985e98b7e61642229b77.zip
support job batching (#12)
* support job batching * worker: pull more frequently
Diffstat (limited to 'test_joblib.py')
-rw-r--r--test_joblib.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test_joblib.py b/test_joblib.py
index 865cfab..1a760f8 100644
--- a/test_joblib.py
+++ b/test_joblib.py
@@ -49,6 +49,16 @@ class TestJoblib:
assert None == (await queue.acquire(jobtype="testing"))[1]
@pytest.mark.asyncio
+ async def test_request_and_acquire_batch(self, queue, payload):
+ # request should succeed
+ await queue.request(jobtype="testing", payload=[payload]*5)
+ # acquire should return same payload
+ for _ in range(5):
+ assert payload == (await queue.acquire(jobtype="testing"))[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