🎙 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 4 of 10

What is setUp used for?

What is setUp used for?

  1. A.It runs once after all tests finish
  2. B.It installs the test framework
  3. C.It runs before each test to create fresh data
  4. 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 →