Bird
0
0

Which framework automatically discovers tests by looking for files and functions starting with 'test' without extra configuration?

easy🧠 Conceptual Q2 of 15
PyTest - Basics and Setup
Which framework automatically discovers tests by looking for files and functions starting with 'test' without extra configuration?
Aunittest
Bpytest
Cnose
DNone of the above
Step-by-Step Solution
Solution:
  1. Step 1: Understand test discovery in frameworks

    Test discovery means finding test files and functions automatically.
  2. Step 2: Check which framework uses naming conventions for discovery

    pytest looks for files and functions starting with 'test' by default without config.
  3. Final Answer:

    pytest automatically discovers tests by naming convention -> Option B
  4. Quick Check:

    Auto discovery by name = pytest [OK]
Quick Trick: pytest finds tests by default 'test_' prefix [OK]
Common Mistakes:
MISTAKES
  • Thinking unittest discovers tests automatically
  • Confusing nose's discovery with pytest
  • Believing extra config is always needed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes