Challenge - 5 Problems
Coverage Report Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
Output of pytest coverage terminal report
What is the output of the following pytest coverage command when run in a terminal?
pytest --cov=my_module --cov-report=termAttempts:
2 left
💡 Hint
Think about what the 'term' option means for coverage reports.
✗ Incorrect
The 'term' coverage report option prints a coverage summary directly in the terminal after tests run.
❓ Predict Output
intermediate1:30remaining
Result of pytest coverage HTML report generation
After running the command below, what will you find in your project directory?
pytest --cov=my_module --cov-report=htmlAttempts:
2 left
💡 Hint
HTML reports are meant to be viewed in a web browser.
✗ Incorrect
The 'html' report option creates a folder named htmlcov with an index.html file and related assets for a detailed coverage report.
❓ Predict Output
advanced1:30remaining
Effect of pytest coverage XML report option
What is the effect of running this command?
pytest --cov=my_module --cov-report=xmlAttempts:
2 left
💡 Hint
XML reports are used for integration with other tools.
✗ Incorrect
The 'xml' report option creates a coverage.xml file with coverage data in XML format for tools like CI servers.
🧠 Conceptual
advanced1:00remaining
Choosing coverage report formats for different needs
Which coverage report format is best suited for viewing detailed coverage information interactively in a web browser?
Attempts:
2 left
💡 Hint
Think about which format uses web pages.
✗ Incorrect
HTML reports provide detailed, interactive coverage views in a browser, unlike terminal or XML formats.
❓ framework
expert2:00remaining
Combining multiple coverage report formats in pytest
Which command correctly generates both terminal and XML coverage reports in one pytest run?
Attempts:
2 left
💡 Hint
Multiple reports are separated by commas without spaces.
✗ Incorrect
To generate multiple coverage reports, list them separated by commas with no spaces after --cov-report.