Complete the code to name a test function that pytest will discover automatically.
def [1](): assert 1 + 1 == 2
Pytest discovers test functions that start with test_. So test_addition is correct.
Complete the code to name a test file that pytest will discover automatically.
# File name: [1] def test_example(): assert True
Pytest discovers test files that start with test_ or end with _test.py. Here, test_example.py is correct.
Fix the error in the test class name so pytest will discover its test methods.
class [1]: def test_method(self): assert True
Pytest discovers test classes that start with Test and do not have an __init__ method. So TestMyClass is correct.
Fill both blanks to create a test function that pytest will discover and run.
def [1]([2]): assert [2] > 0
The function name must start with test_ and the parameter can be any valid name, here value is used.
Fill all three blanks to create a dictionary comprehension that filters test data for pytest.
filtered = { [1]: [2] for [1] in data if [2] [3] 10 }The comprehension uses key and value as variable names, and filters values greater than 10 using >.