Introduction
When running many tests, it can be hard to know how far along the process is or if tests are stuck. Test progress reporting helps by showing updates during testing, so you can see what is happening and estimate how much time is left.
Imagine baking a batch of cookies in the oven. Instead of waiting without knowing, you check the timer and peek through the oven window to see how many cookies are golden brown. This helps you know when the batch is done or if something is wrong.
┌───────────────────────────────┐ │ Test Suite Start │ ├─────────────┬───────────────┤ │ Running │ Progress Info │ │ Tests │ - Passed │ │ │ - Failed │ │ │ - Current │ ├─────────────┴───────────────┤ │ Test Suite End │ └───────────────────────────────┘
import unittest class SimpleTest(unittest.TestCase): def test_pass(self): self.assertEqual(1 + 1, 2) def test_fail(self): self.assertEqual(2 * 2, 5) if __name__ == '__main__': unittest.main(buffer=False, verbosity=2)