Bird
0
0

You want to exclude all files in a 'migrations' folder from coverage reports. Which .coveragerc setting achieves this?

hard📝 Application Q8 of 15
Django - Testing Django Applications
You want to exclude all files in a 'migrations' folder from coverage reports. Which .coveragerc setting achieves this?
A[run] omit = */migrations/*
B[report] include = */migrations/*
C[run] include = */migrations/*
D[report] omit = */static/*
Step-by-Step Solution
Solution:
  1. Step 1: Understand omit usage in .coveragerc

    The 'omit' setting under [run] excludes files or folders from coverage measurement.
  2. Step 2: Match pattern to migrations folder

    [run] omit = */migrations/* correctly uses 'omit = */migrations/*' to exclude all migrations files.
  3. Final Answer:

    [run] omit = */migrations/* -> Option A
  4. Quick Check:

    Exclude folder = omit pattern in [run] section [OK]
Quick Trick: Use omit in [run] to exclude folders from coverage [OK]
Common Mistakes:
MISTAKES
  • Using include instead of omit to exclude files
  • Placing omit under [report] instead of [run]
  • Wrong folder pattern in omit

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Django Quizzes