summaryrefslogtreecommitdiff
path: root/testing/tests
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/perf/test_encdecpool.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/testing/tests/perf/test_encdecpool.py b/testing/tests/perf/test_encdecpool.py
index 4eb990a8..919fdaa7 100644
--- a/testing/tests/perf/test_encdecpool.py
+++ b/testing/tests/perf/test_encdecpool.py
@@ -18,19 +18,16 @@ def create_encrypt(amount, size):
pool = SyncEncrypterPool(client._crypto, client._sync_db)
pool.start()
request.addfinalizer(pool.stop)
- return pool
+ docs = [
+ SoledadDocument(doc_id=uuid4().hex, rev='rev',
+ json=json.dumps(DOC_CONTENT))
+ for _ in xrange(amount)
+ ]
+ return pool, docs
@pytest.inlineCallbacks
- def put_and_wait(pool):
- doc_ids = []
- deferreds = []
- for _ in xrange(amount):
- doc = SoledadDocument(
- doc_id=uuid4().hex, rev='rev',
- json=json.dumps(DOC_CONTENT))
- deferreds.append(pool.encrypt_doc(doc))
- doc_ids.append(doc.doc_id)
- yield gatherResults(deferreds)
+ def put_and_wait(pool, docs):
+ yield gatherResults([pool.encrypt_doc(doc) for doc in docs])
yield txbenchmark_with_setup(setup, put_and_wait)
return test