Lesson 01 of 06 · about 4 min

One test, three durations

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6

pytest parametrize runs one test body over a table of inputs. Copying the test three times drifts the day someone changes the assertion in only one copy. A value outside the legal range is a different test: it expects a reject.

HEATER_ON durations 1, 30, and 60 are legal. Duration 0 is not. Choose how the legal cases run, and what happens to 0.

On the Knowledge page

Resources