Complete the code to run tests automatically in CI.
def test_addition(): assert 2 + 2 == [1]
The test checks if 2 + 2 equals 4, which is correct.
Complete the code to mark a test to run in CI only.
@pytest.mark.[1] def test_feature(): assert True
Marking tests with @pytest.mark.ci helps identify tests to run in CI pipelines.
Fix the error in the test command to run tests in CI.
pytest [1] tests/The correct pytest option to run tests with a marker is '-m ci'.
Fill both blanks to create a test that fails if coverage is below 80%.
pytest --cov=myapp --cov-fail-under=[1] --cov-report=[2]
Setting --cov-fail-under=80 enforces minimum coverage. 'term-missing' shows missing lines in terminal.
Fill all three blanks to create a test report dictionary filtering passed tests.
report = {test: result for test, result in results.items() if result [1] 'passed' and test.startswith([2]) and len(test) [3] 10}The code filters tests where result equals 'passed', test names start with 'test_', and test name length is less than 10.
