aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-08 02:00:38 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-08 02:00:45 +0200
commitccbab37568d861b8a2985875d9992e34ee23c2f6 (patch)
tree1cb162d5c22f46deccfb4322d6ac569912d378c6 /test
parenttest: refactoring (diff)
downloadcimple-ccbab37568d861b8a2985875d9992e34ee23c2f6.tar.gz
cimple-ccbab37568d861b8a2985875d9992e34ee23c2f6.zip
test: dedupe code by using @parametrize
Diffstat (limited to 'test')
-rw-r--r--test/py/test_repo.py25
1 files changed, 8 insertions, 17 deletions
diff --git a/test/py/test_repo.py b/test/py/test_repo.py
index c6cd6a2..a981169 100644
--- a/test/py/test_repo.py
+++ b/test/py/test_repo.py
@@ -54,23 +54,14 @@ def _test_repo_internal(env, repo, numof_processes, runs_per_process):
assert status == 'finished', f'Invalid status for run {id}: {status}'
-def test_repo_1_client_1_run(env, test_repo):
- _test_repo_internal(env, test_repo, 1, 1)
-
-
-def test_repo_1_client_2_runs(env, test_repo):
- _test_repo_internal(env, test_repo, 1, 2)
-
-
-def test_repo_1_client_10_runs(env, test_repo):
- _test_repo_internal(env, test_repo, 1, 10)
-
-
-@pytest.mark.stress
-def test_repo_1_client_2000_runs(env, test_repo):
- _test_repo_internal(env, test_repo, 1, 2000)
+@pytest.mark.parametrize('numof_clients,runs_per_client',
+ [(1, 1), (1, 2), (1, 10), (2, 1), (2, 10), (10, 1), (10, 10)])
+def test_repo(env, test_repo, numof_clients, runs_per_client):
+ _test_repo_internal(env, test_repo, numof_clients, runs_per_client)
@pytest.mark.stress
-def test_repo_4_clients_500_runs(env, test_repo):
- _test_repo_internal(env, test_repo, 4, 500)
+@pytest.mark.parametrize('numof_clients,runs_per_client',
+ [(1, 2000), (4, 500)])
+def test_repo_stress(env, test_repo, numof_clients, runs_per_client):
+ _test_repo_internal(env, test_repo, numof_clients, runs_per_client)