Complete the code to import pytest in a test file.
import [1]
pytest is the testing framework used to write and run tests.
Complete the code to define a test function inside a test package.
def [1](): assert 1 + 1 == 2
pytest recognizes functions starting with 'test' as test cases.
Fix the error in the test package __init__.py to make it a package.
# This file makes the directory a package [1]
An empty __init__.py file with 'pass' makes the folder a package without errors.
Fill both blanks to create a test package with a test module and a test function.
tests/ __init__.py test_math.py # Inside test_math.py: def [1](): assert 3 * 3 == [2]
The function name must start with 'test' and the assertion must check the correct product 9.
Fill all three blanks to create a test package with a test module, test function, and a failing assertion.
tests/ __init__.py test_strings.py # Inside test_strings.py: def [1](): result = 'hello'.upper() assert result == '[2]' assert result != '[3]'
The test function checks that 'hello'.upper() equals 'HELLO' and is not 'hello'.
