Complete the code to run pytest with coverage reporting.
pytest --cov=[1] tests/The --cov option specifies the module to measure coverage for. It should be the main code folder, not the tests folder.
Complete the pytest command to generate a coverage report in XML format for CI tools.
pytest --cov=my_module --cov-report=[1] tests/The xml report format is commonly used in CI pipelines to integrate with coverage tools.
Fix the error in the pytest coverage command to include branch coverage.
pytest --cov=my_module --cov-report=xml --cov-branch=[1] tests/The correct option to enable branch coverage is --cov-branch=true.
Fill both blanks to configure pytest coverage to fail if coverage is below 80% and to show the report in the terminal.
pytest --cov=my_module --cov-fail-under=[1] --cov-report=[2] tests/
The --cov-fail-under=80 option makes the test fail if coverage is below 80%. The term report shows coverage in the terminal.
Fill all four blanks to create a pytest coverage command that measures coverage, generates XML and HTML reports, and fails if coverage is below 90%.
pytest --cov=[1] --cov-report=[2] --cov-report=[3] --cov-fail-under=[4] tests/
This command measures coverage on my_module, outputs XML and HTML reports, and fails if coverage is below 90%.