Testing Questions and Answers

Practice Mode
Showing 10 of 25 questions
Q21
Which decorator in pytest is used to parametrize tests?
  • A A) @pytest.multi
  • B B) @pytest.parameter
  • C C) @pytest.mark.parametrize
  • D D) @pytest.case
Answer: Option C
Explanation: It allows running a test with different data sets.
Q22
Which command is used to install pytest?
  • A A) install pytest
  • B B) python -m install pytest
  • C C) pip install pytest
  • D D) pytest setup
Answer: Option C
Explanation: Most Python packages are installed using pip.
Q23
In unittest, which method checks if two items are not equal?
  • A A) assertEqual()
  • B B) assertNotEqual()
  • C C) assertUnEqual()
  • D D) checkNotEqual()
Answer: Option B
Explanation: It is the opposite of assertEqual().
Q24
Which of the following are integration tests mainly focused on?
  • A A) UI appearance
  • B B) How modules interact together
  • C C) Database design
  • D D) Variable naming
Answer: Option B
Explanation: Integration tests check combined components' functioning.
Q25
What type of testing ensures that new changes do not break existing functionality?
  • A A) Load testing
  • B B) Regression testing
  • C C) End-to-end testing
  • D D) Smoke testing
Answer: Option B
Explanation: The goal is to confirm old features still work properly.
Questions and Answers for Competitive Exams Various Entrance Test