Bird
0
0

Which of the following commands correctly runs Django tests with coverage measurement?

easy📝 Syntax Q3 of 15
Django - Testing Django Applications
Which of the following commands correctly runs Django tests with coverage measurement?
Apython manage.py coverage test
Bcoverage run manage.py test
Cmanage.py test --coverage
Dcoverage test manage.py run
Step-by-Step Solution
Solution:
  1. Step 1: Recall coverage command usage

    The coverage tool runs a Python script with coverage run.
  2. Step 2: Apply to Django tests

    To run Django tests with coverage, use coverage run manage.py test.
  3. Final Answer:

    coverage run manage.py test -> Option B
  4. Quick Check:

    Coverage runs scripts with coverage run, not as a manage.py subcommand. [OK]
Quick Trick: Use 'coverage run' before manage.py test [OK]
Common Mistakes:
MISTAKES
  • Using coverage as a manage.py subcommand
  • Incorrect command order
  • Confusing coverage options with test options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes