Complete the code to parametrize the test with a single value.
import pytest @pytest.mark.parametrize('number', [[1]]) def test_is_positive(number): assert number > 0
The test is parametrized with the value 5, which is positive, so the assertion passes.
Complete the code to parametrize the test with multiple values using a single parameter.
import pytest @pytest.mark.parametrize('value', [1, 2, [1]]) def test_is_integer(value): assert isinstance(value, int)
The parameter list includes 1, 2, and 3, all integers, so the test passes for all.
Fix the error in the code by completing the parameter list correctly.
import pytest @pytest.mark.parametrize('item', [1]) def test_not_none(item): assert item is not None
The parameter list must be a list of values. Using [1, 2, 3] correctly passes the test.
Fill both blanks to parametrize the test with a single parameter and check for even numbers.
import pytest @pytest.mark.parametrize('[1]', [2, 4, 6, 8]) def test_is_even([2]): assert [2] % 2 == 0
Using 'num' as the parameter name in both places matches the parameterized values and the test argument.
Fill all three blanks to parametrize the test with a single parameter and assert it is a string.
import pytest @pytest.mark.parametrize('[1]', ['apple', 'banana', 'cherry']) def test_is_string([2]): assert isinstance([3], str)
The parameter name 'fruit' is used in the decorator and as the function argument. The assertion checks if 'fruit' is a string.