Bird
0
0

If you run pytest tests/helpers/test_utils.py, which tests will be executed?

medium📝 Predict Output Q5 of 15
PyTest - Basics and Setup
If you run pytest tests/helpers/test_utils.py, which tests will be executed?
AOnly tests inside test_utils.py
BAll tests inside tests/ folder
CAll tests in the project
DNo tests will run
Step-by-Step Solution
Solution:
  1. Step 1: Understand pytest file argument behavior

    Specifying a test file runs only tests inside that file.
  2. Step 2: Analyze the command

    pytest tests/helpers/test_utils.py runs tests only in test_utils.py.
  3. Final Answer:

    Only tests inside test_utils.py -> Option A
  4. Quick Check:

    File argument runs tests in that file only [OK]
Quick Trick: Specify test file to run only its tests [OK]
Common Mistakes:
MISTAKES
  • Expecting all tests to run
  • Running tests outside specified file

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PyTest Quizzes