# Parametrized Test

*noun*

say it: **“puh-RAM-ih-tryzd TEST”** **/pəˈræmətraɪzd tɛst/**

One test that runs several times, each time with a different set of inputs and the answer expected, instead of a copy of the test for each case.

## What is a **parametrized test**?

A **parametrized test** runs the same test with several sets of inputs and expected answers, instead of copying the test over and over.

```python
import pytest

def shipping(total):
    return 0 if total >= 50 else 5

@pytest.mark.parametrize("total, expected", [(20, 5), (50, 0), (80, 0)])
def test_shipping(total, expected):
    assert shipping(total) == expected
```

## In a sentence

- “pytest reports each case of a **parametrized test** as its own pass or fail.”
- “A **parametrized test** checked shipping for totals of 20, 50 and 80 in one function.”

Level: Freelancer · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=4)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/parametrized-test
