pytest parametrize twice: Test All Possible Combinations of Two Sets of Parameters

pytest parametrize twice: Test All Possible Combinations of Two Sets of Parameters

If you want to test the combinations of two sets of parameters, writing all possible combinations can be time-consuming and is difficult to read. 

You can save your time by using pytest.mark.parametrize twice instead. From the output of pytest, we can see that all possible combinations of the given functions and inputs are tested.

My previous tips on testing.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran