parameterized
Parameterized testing with any Python test framework
What it is and what it does
Parameterized is a decorator library that lets you write a single test function and run it against multiple sets of inputs, eliminating repetitive test code. It works across nose, pytest, unittest, and other test runners, generating separate test cases for each parameter set so they appear as distinct tests in your test output.
The package provides two main decorators: @parameterized for standalone test functions and @parameterized.expand for test methods within classes. You pass a list of tuples, param objects, or a callable that returns test cases, and the decorator automatically generates individual test cases. It has no runtime dependencies and installs with minimal friction, making it a lightweight addition to any test suite.
Use it for:
- Test the same logic across multiple input values (e.g., testing a math function with different numbers) without writing duplicate test methods.
- Generate test cases from external data sources like JSON files or CSV data by passing a callable that loads and returns test parameters.
- Test class behavior with different initial states by using @parameterized_class to instantiate a test class multiple times with different attributes.
- Improve test readability and maintainability by centralizing test data in one place rather than scattering it across multiple test methods.
- Integrate parameterized tests into existing unittest, pytest, or nose test suites without changing the test runner or project structure.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Parameterized testing decorator that works with nose, pytest, unittest, and other Python test frameworks to run the same test function across multiple input sets.
Yes, if you use unittest, nose, or pytest 3 and want to reduce test boilerplate. The package is stable and has no dependencies. However, maintenance is dormant with the last release on 2023-03-27, so compatibility with future Python versions is uncertain. Check the compatibility table for your specific test framework and Python version before relying on it for new projects.
Install
parameterized on PyPI
pip
pip install parameterizeduv
uv add parameterizedpoetry
poetry add parameterizedInstalling parameterized
Before you install
Low friction installation with no runtime dependencies. Maintenance is dormant—last release was 2023-03-27 over a year ago—but the package is stable and widely used in the top 5000 PyPI packages. No active development signal, so expect no new features or rapid bug fixes.
License in practice
FreeBSD license is permissive, allowing commercial and private use with minimal restrictions. No notable licensing constraints for most projects.
Quickstart
pip install parameterized
from parameterized import parameterized
import unittest
class TestExample(unittest.TestCase):
@parameterized.expand([
("case1", 2, 4),
("case2", 3, 9),
])
def test_square(self, name, input_val, expected):
self.assertEqual(input_val ** 2, expected)
Requires Python 3.7 or later. Some test frameworks have known compatibility gaps (e.g., pytest 4, pytest fixtures, nose with Python 3.10 or 3.11)—check the compatibility table in the documentation.
Verify before relying
- Whether dormant maintenance will affect compatibility with Python versions beyond 3.11
- Current state of known compatibility issues with pytest 4 and pytest fixtures (issue #34, #81)
- Whether the package will receive updates for future Python releases
Package facts
| License | FreeBSD (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 1,236 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 21,140,902/month — #1,010 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: parameterized-0.9.0-py2.py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
ddtddt multiplies a single test case across…
permissive · top 5,000 on PyPI
parametrizeProvides a `@parametrize` decorator that works…
permissive · top 15,000 on PyPI
unittest-parametrizeAdds parametrization support to unittest…
permissive · top 15,000 on PyPI
testscenariostestscenarios extends Python's unittest to run…
permissive · top 15,000 on PyPI
allpairspyGenerates minimal test case combinations using…
permissive · top 15,000 on PyPI
nose2nose2 is a test runner that extends Python's…
permissive · top 15,000 on PyPI
nose-py3nose-py3 extends unittest with automatic test…
copyleft · top 15,000 on PyPI
pytest-casespytest-cases lets you separate test case data…
permissive · top 5,000 on PyPI
paramParam provides declarative class attributes…
permissive · top 5,000 on PyPI
pynosepynose is an updated test runner that extends…
copyleft · top 5,000 on PyPI