The correct syntax requires a string of parameter names separated by commas and a list of tuples with corresponding values.
Step 2: Analyze options
@pytest.mark.parametrize('m,n', [(1, 2), (3, 4)]) correctly uses a string 'm,n' and a list of tuples [(1, 2), (3, 4)]. Options B and C incorrectly format the values. @pytest.mark.parametrize('m', [1, 2]) @pytest.mark.parametrize('n', [3, 4]) uses multiple decorators which is valid but changes the test behavior.
Final Answer:
@pytest.mark.parametrize('m,n', [(1, 2), (3, 4)]) -> Option B
Quick Check:
Parametrize needs parameter string and list of tuples [OK]
Quick Trick:Use string of params and list of tuples [OK]
Common Mistakes:
MISTAKES
Passing a flat list instead of list of tuples
Using list of strings instead of a single string for parameters
Misusing multiple decorators without understanding combinations
Master "Parametrize" in PyTest
9 interactive learning modes - each teaches the same concept differently