Complete the code to import the pytest module correctly.
import [1]
The pytest module is imported using import pytest. This allows you to use pytest features in your test files.
Complete the code to define a simple test function using pytest.
def [1](): assert 1 + 1 == 2
Pytest discovers test functions that start with test_. Naming the function test_addition ensures pytest will run it.
Fix the error in the test function name so pytest can discover it.
def [1](): assert 'hello'.upper() == 'HELLO'
Pytest requires test function names to start with test_. Changing the name to test_hello fixes the discovery issue.
Fill both blanks to create a test module with two test functions using pytest.
import pytest def [1](): assert 3 * 3 == 9 def [2](): assert 'abc'.capitalize() == 'Abc'
Both function names start with test_, so pytest will find and run them as tests.
Fill all three blanks to write a pytest test module that imports pytest, defines a test function, and uses an assertion.
import [1] def [2](): result = 5 + 5 assert result [3] 10
The module imports pytest. The test function is named starting with test_. The assertion checks if result == 10.