← 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?
- A.No examples were found in the docstrings
- B.Three examples failed
- C.Three docstring examples ran and all of them gave the expected output
- 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 →