diff options
author | Victor Shyba <victor1984@riseup.net> | 2016-11-19 21:54:13 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-12-12 09:15:21 -0200 |
commit | bfe330a7eaad1c51640dbbb91be233a65d2a4bd7 (patch) | |
tree | cd851c3e329f2dc900f556f7ae55f89ca9ffe50b /testing/tests/benchmarks/test_crypto.py | |
parent | 63c33b1b20e013571fb870205302bbc9e4a06e23 (diff) |
[tests] fixes test_crypto bench
encrypt returns a deferred and needs the adapted benchmark runner.
Diffstat (limited to 'testing/tests/benchmarks/test_crypto.py')
-rw-r--r-- | testing/tests/benchmarks/test_crypto.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/testing/tests/benchmarks/test_crypto.py b/testing/tests/benchmarks/test_crypto.py index 367c3b5b..75ad9a30 100644 --- a/testing/tests/benchmarks/test_crypto.py +++ b/testing/tests/benchmarks/test_crypto.py @@ -20,7 +20,8 @@ LIMIT = int(float(os.environ.get('SIZE_LIMIT', 50 * 1000 * 1000))) def create_doc_encryption(size): @pytest.mark.benchmark(group="test_crypto_encrypt_doc") - def test_doc_encryption(soledad_client, benchmark, payload): + @pytest.inlineCallbacks + def test_doc_encryption(soledad_client, txbenchmark, payload): crypto = soledad_client()._crypto DOC_CONTENT = {'payload': payload(size)} @@ -28,7 +29,7 @@ def create_doc_encryption(size): doc_id=uuid4().hex, rev='rev', json=json.dumps(DOC_CONTENT)) - benchmark(crypto.encrypt_doc, doc) + yield txbenchmark(crypto.encrypt_doc, doc) return test_doc_encryption |