Complete the code to import the pytest module correctly.
import [1]
We import pytest to use its features for testing and configuration.
Complete the code to define a pytest fixture that provides a fixed value.
@pytest.fixture def fixed_value(): return [1]
The fixture returns a fixed value 42 to standardize test input.
Fix the error in the test function to use the fixture correctly.
def test_fixed(fixed_value): assert fixed_value [1] 42
The test asserts that the fixture value equals 42 to confirm standard behavior.
Fill both blanks to configure pytest to stop after first failure and show detailed info.
def pytest_addoption(parser): parser.addoption('--maxfail', default=[1], help='Stop after max failures') parser.addoption('--tb', default=[2], help='Traceback style')
Setting maxfail=1 stops tests after one failure. Using tb='long' shows detailed tracebacks.
Fill all three blanks to create a pytest.ini file content that sets test paths, disables warnings, and sets log level.
[pytest] testpaths = [1] filterwarnings = [2] log_cli_level = [3]
The testpaths points to the tests folder. filterwarnings disables deprecation warnings. log_cli_level sets logging to INFO level.