Using test parallelisation and parameterisation instead of loop

12 views
Skip to first unread message

Akshay Maldhure

unread,
Jan 31, 2020, 3:35:36 AM1/31/20
to lemoncheesecake
I have a single lcc test which has a for loop that obviously does some tests on all the elements in a list sequentially. Below is the example code.

@lcc.suite("Some suite")
class SomeSuite:

@lcc.test("Do things in a for loop")
def test_some_test(self):
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for element in my_list:
# do some tests with element

Is it feasible to parameterised this test as per http://docs.lemoncheesecake.io/en/latest/parametrized.html AND run all the tests in parallel?

Nicolas Delon

unread,
Jan 31, 2020, 6:39:41 AM1/31/20
to lemoncheesecake
Hello,

Yes, parametrized tests can be parallized like any other test.

Nicolas.

Akshay Maldhure

unread,
Jan 31, 2020, 6:41:49 AM1/31/20
to lemoncheesecake
How? By simply using the --threads option while running the tests?

Nicolas Delon

unread,
Jan 31, 2020, 6:46:57 AM1/31/20
to lemoncheesecake
Yes, like any other kind of tests. There is nothing specific here.
Reply all
Reply to author
Forward
0 new messages