← Quiz: Testing Python Code: all 10 questions
Quiz: Testing Python Code · Question 4 of 10
What is setUp used for?
What is setUp used for?
- A.It runs once after all tests finish
- B.It installs the test framework
- C.It runs before each test to create fresh data
- D.It marks a test as expected to fail
Answer & explanation
Correct answer: It runs before each test to create fresh data
Each test then starts from the same clean state.
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 →