test runner
A test runner is a software tool that discovers and executes a project’s automated tests, then reports the results. It locates test files according to naming conventions or configuration, loads them, runs each test in a defined order, captures assertion outcomes, and produces a structured report of passes, failures, errors, and skipped tests.
Many runners also manage setup and teardown actions, run independent tests in parallel, repeat flaky cases, filter tests by markers or patterns, and integrate coverage measurement.
A test runner is conceptually distinct from the testing framework that defines how tests are written. The framework provides the assertion API and fixture model, while the runner drives the execution pipeline. In practice, both responsibilities are often bundled in the same tool. Widely used examples include:
- pytest and unittest in Python
- JUnit and TestNG in Java
- Jest, Mocha, and Vitest in JavaScript
- RSpec in Ruby
- The built-in
go testin Go
Test runners are a core component of continuous integration pipelines, where every commit triggers a runner to validate the change before merge.
Related Resources
Tutorial
Python's unittest: Writing Unit Tests for Your Code
In this tutorial, you'll learn how to use the unittest framework to create unit tests for your Python code. Along the way, you'll also learn how to create test cases, fixtures, test suites, and more.
For additional information on related topics, take a look at the following resources:
- pytest Tutorial: Effective Python Testing (Tutorial)
- How to Provide Test Fixtures for Django Models in Pytest (Tutorial)
- Continuous Integration With Python: An Introduction (Tutorial)
- Continuous Integration and Deployment for Python With GitHub Actions (Tutorial)
- Build Robust Continuous Integration With Docker and Friends (Tutorial)
- Write Unit Tests for Your Python Code With ChatGPT (Tutorial)
- Python's assert: Debug and Test Your Code Like a Pro (Tutorial)
- Understanding the Python Mock Object Library (Tutorial)
- Testing Your Code With Python's unittest (Course)
- Python's unittest: Writing Unit Tests for Your Code (Quiz)
- Testing Your Code With pytest (Course)
- Effective Testing with Pytest (Quiz)
- Continuous Integration With Python (Course)
- Python Continuous Integration and Deployment Using GitHub Actions (Course)
- GitHub Actions for Python (Quiz)
- Using Python's assert to Debug and Test Your Code (Course)
- Python's assert: Debug and Test Your Code Like a Pro (Quiz)
- Improving Your Tests With the Python Mock Object Library (Course)
- Exploring unittest.mock in Python (Course)
- Understanding the Python Mock Object Library (Quiz)