Skip to content
BENIBIX Learn

Test Runner

Development🧪 Testing & QualityTest Basics

Also known as Test Harness, Test Command

The tool that finds your tests, runs them and shows how many passed.

Think of it like

Think of it like a teacher. They hand out the quiz, mark it and read the score.

Example

Lucy types pytest in her project folder. It finds 48 tests in 6 files, runs them and prints 48 passed in 1.2 seconds.

Why it matters

Without a runner you would call every test by hand. The runner makes the whole suite one command.

Definition

A test runner is the tool that finds your tests, runs them and reports the results. It looks for files with names like test_cart.py or cart.test.js. Then it runs each test and counts how many passed and failed. For each failure it shows the line and the values that did not match. pytest, Jest and Vitest are all test runners.

Example code

console
$ pytest -q test_cart.py
.                                  [100%]
1 passed in 0.02s
pytest found one test, ran it and reported a pass.

Common mistake

Naming a test file so the runner cannot find it. A test in check_cart.py may never run, and never fail.

Key takeaways

  1. 1
    Finds the tests. By file and function names.
  2. 2
    Runs them all. One command.
  3. 3
    Reports the score. Passed, failed, and why.