Complete the code to mark the test function to run with multiple values for parameter 'x'.
import pytest @pytest.mark.parametrize('x', [1]) def test_is_positive(x): assert x > 0
The @pytest.mark.parametrize decorator requires an iterable like a list for parameter values. Using a list [1, 2, 3] correctly passes multiple values.
Complete the code to parametrize two parameters 'a' and 'b' with pairs of values.
import pytest @pytest.mark.parametrize('[1]', [(1, 2), (3, 4)]) def test_sum(a, b): assert a + b > 0
The parameter names must be a string with names separated by commas, like 'a, b'.
Fix the error in the parametrize decorator to correctly pass multiple parameter sets.
import pytest @pytest.mark.parametrize('x, y', [1]) def test_multiply(x, y): assert x * y >= 0
The parameter values must be a list of tuples, each tuple matching the parameters. Option B correctly provides pairs (tuples) for 'x' and 'y'.
Fill both blanks to parametrize a test with parameters 'name' and 'age' and two sets of values.
import pytest @pytest.mark.parametrize([1], [2]) def test_person(name, age): assert isinstance(name, str) and age > 0
The first blank must be the parameter names as a string separated by commas. The second blank must be a list of tuples with matching values. Option C has correct types for both parameters.
Fill all three blanks to parametrize a test with parameters 'x', 'y', 'expected' and three test cases.
import pytest @pytest.mark.parametrize([1], [2]) def test_add(x, y, expected): assert x + y == [3]
The first blank is the parameter names string. The second blank is the list of tuples with test cases. The third blank is the variable 'expected' used in the assertion.