diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-08-22 19:22:15 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2016-08-22 19:22:15 -0300 |
commit | a64095ad5e6c6a36221444a34d8d56c0ae1c6150 (patch) | |
tree | cfa9a9f2df857a58ab990d63a0896b029688c7a2 /testing | |
parent | bad25ba9a5e7e5296b79544f50cafc47599a76b9 (diff) |
[test] refactor load_up for readability
defer parameter wasnt clear
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/perf/test_sqlcipher.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/testing/tests/perf/test_sqlcipher.py b/testing/tests/perf/test_sqlcipher.py index 511080a1..1fce1c3e 100644 --- a/testing/tests/perf/test_sqlcipher.py +++ b/testing/tests/perf/test_sqlcipher.py @@ -8,15 +8,9 @@ from twisted.internet.defer import gatherResults def load_up(client, amount, size, defer=True): content = 'x'*size - deferreds = [] - # create a bunch of local documents - for i in xrange(amount): - d = client.create_doc({'content': content}) - deferreds.append(d) + results = [client.create_doc({'content': content}) for _ in xrange(amount)] if defer: - d = gatherResults(deferreds) - d.addCallback(lambda _: None) - return d + return gatherResults(results) def build_test_sqlcipher_async_create(amount, size): |