summaryrefslogtreecommitdiff
path: root/testing/tests/conftest.py
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-09-01 08:53:54 -0300
committerdrebs <drebs@riseup.net>2017-09-05 11:17:08 -0300
commit3a09cef55a59681ae3799c69d160f6f89356921d (patch)
tree8160ee83ae87f26e294bf07a3192d9856977d250 /testing/tests/conftest.py
parent654ec33efae4050f513f6e9d3f1b33c3a39dbedf (diff)
[test] use indexes in clean client's dbs
Diffstat (limited to 'testing/tests/conftest.py')
-rw-r--r--testing/tests/conftest.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py
index 87742dfe..c91bdbc0 100644
--- a/testing/tests/conftest.py
+++ b/testing/tests/conftest.py
@@ -1,3 +1,4 @@
+import glob
import json
import os
import pytest
@@ -234,10 +235,11 @@ def soledad_client(tmpdir, soledad_server, remote_db, soledad_dbs, request):
# in some tests we might want to use the same user and remote database
# but with a clean/empty local database (i.e. download benchmarks), so
# here we provide a way to do that.
- db_file = '%s.db' % default_uuid
+ idx = 1
if force_fresh_db:
- prefix = uuid4().hex
- db_file = prefix + '-' + db_file
+ # find the next index for this user
+ idx = len(glob.glob('%s/*-*.db' % tmpdir.strpath)) + 1
+ db_file = '%s-%d.db' % (default_uuid, idx)
local_db_path = os.path.join(tmpdir.strpath, db_file)
soledad_client = Soledad(