Bird
0
0

In pytest, what is the required prefix for a function to be recognized as a test?

easy🧠 Conceptual Q2 of 15
PyTest - Test Organization
In pytest, what is the required prefix for a function to be recognized as a test?
Acheck_
Btest_
Crun_
Dverify_
Step-by-Step Solution
Solution:
  1. Step 1: Recall pytest naming conventions

    Pytest recognizes test functions by the prefix 'test_'.
  2. Step 2: Match options with this rule

    Only test_ uses the correct prefix 'test_'.
  3. Final Answer:

    test_ -> Option B
  4. Quick Check:

    Test function prefix = test_ [OK]
Quick Trick: Always start test function names with 'test_' [OK]
Common Mistakes:
MISTAKES
  • Using other prefixes like run_ or check_
  • Not prefixing test functions at all
  • Assuming any function is a test

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes