--- id: parameterized version: "0.9.0" license: FreeBSD license_treatment: permissive maintenance: dormant --- # parameterized — Parameterized testing with any Python test framework License: permissive · Maintenance: dormant · Downloads: 21.1M/mo ## 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 above — 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 pip install parameterized uv add parameterized poetry add parameterized ## Installing 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_current - Install friction: low - Maintenance: dormant - Downloads: 21.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags parameterized testing decorator, test multiple inputs same function, pytest parameterize alternative, unittest test data driven, nose parameterized tests, data-driven testing python, test case generation, test-utilities, data-driven-testing [View on SkillFed](https://skillfed.io/packages/parameterized) · [View on PyPI](https://pypi.org/project/parameterized/)