🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Testing Python Code: all 10 questions

Quiz: Testing Python Code · Question 8 of 10

doctest.testmod() returns TestResults(failed=0, attempted=3). What does this mean?

doctest.testmod() returns TestResults(failed=0, attempted=3). What does this mean?

  1. A.No examples were found in the docstrings
  2. B.Three examples failed
  3. C.Three docstring examples ran and all of them gave the expected output
  4. D.The module has three functions without docstrings
Answer & explanation

Correct answer: Three docstring examples ran and all of them gave the expected output

attempted counts the examples that ran; failed counts the ones whose output did not match.

Can you get the rest right without peeking?

Take the timed Quiz: Testing Python Code quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →