Bird
0
0

What will happen if you run coverage run -m flask run instead of coverage run -m pytest?

medium📝 component behavior Q5 of 15
Flask - Testing Flask Applications
What will happen if you run coverage run -m flask run instead of coverage run -m pytest?
ACoverage will generate a coverage report immediately
BCoverage will run tests as usual
CCoverage will produce an error and stop
DCoverage will measure the Flask app runtime, not tests
Step-by-Step Solution
Solution:
  1. Step 1: Understand coverage run target

    Running 'coverage run -m flask run' measures the Flask app running, not tests.
  2. Step 2: Compare with pytest usage

    'coverage run -m pytest' runs tests and measures coverage of test execution.
  3. Final Answer:

    Coverage will measure the Flask app runtime, not tests -> Option D
  4. Quick Check:

    Coverage run target affects what is measured [OK]
Quick Trick: Run coverage on tests, not app runtime, for test coverage [OK]
Common Mistakes:
MISTAKES
  • Assuming coverage runs tests automatically
  • Expecting immediate report without tests
  • Confusing app run with test run

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Flask Quizzes