{"id":24200,"library":"parametrize","title":"parametrize","description":"A drop-in replacement for @pytest.mark.parametrize that works with unittest.TestCase classes, enabling parameterized tests without needing pytest. Current version 0.2.0. Development appears low-activity.","status":"active","version":"0.2.0","language":"python","source_language":"en","source_url":"https://github.com/MrMrRobat/parametrize","tags":["testing","unittest","parameterized","parametrize","decorator"],"install":[{"cmd":"pip install parametrize","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Direct import without submodule leads to AttributeError on parametrize decorator.","wrong":"import parametrize","symbol":"parametrize","correct":"from parametrize import parametrize"}],"quickstart":{"code":"import unittest\nfrom parametrize import parametrize\n\nclass TestMath(unittest.TestCase):\n    @parametrize('a,b,expected', [\n        (1, 1, 2),\n        (2, 2, 4),\n        (3, 5, 8)\n    ])\n    def test_add(self, a, b, expected):\n        self.assertEqual(a + b, expected)\n\nif __name__ == '__main__':\n    unittest.main()","lang":"python","description":"Basic usage with unittest.TestCase showing parameterized tests."},"warnings":[{"fix":"Use @pytest.mark.parametrize and run tests with pytest instead of unittest.","message":"parametrize is not actively maintained; consider using pytest's built-in parametrize directly if you can migrate tests away from unittest.TestCase.","severity":"deprecated","affected_versions":"all"},{"fix":"Ensure @parametrize is directly above the test method, with no other decorator in between.","message":"The decorator must be placed above the method definition, not below. Placing it below will silently not work.","severity":"gotcha","affected_versions":"all"},{"fix":"Check that the comma-separated argument names match the method signature.","message":"Argument names in the string must exactly match method parameters. A mismatch will cause a TypeError at test execution.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'0.2.0':22 'activ':27 'appear':24 'class':13 'current':20 'decor':32 'develop':23 'drop':4 'drop-in':3 'enabl':14 'low':26 'low-act':25 'need':18 'parameter':15,30 'parametr':1,31 'pytest':19 'pytest.mark.parametrize':8 'replac':6 'test':16,28 'unittest':29 'unittest.testcase':12 'version':21 'without':17 'work':10","created_at":"2026-05-01T08:11:49.431165+00:00","updated_at":"2026-05-01T08:11:49.431165+00:00","problems":[{"fix":"from parametrize import parametrize","cause":"Import using import parametrize instead of from parametrize import parametrize.","error":"AttributeError: module 'parametrize' has no attribute 'parametrize'"},{"fix":"Ensure the argument names string (e.g., 'a,b,expected') matches method parameters exactly.","cause":"Argument names in the decorator string do not match method parameters, or the tuple lengths mismatch.","error":"TypeError: test_add() missing 2 required positional arguments: 'b' and 'expected'"},{"fix":"Each test tuple must have exactly as many elements as argument names.","cause":"Number of values in a test case tuple does not match the number of argument names.","error":"ValueError: not enough values to unpack (expected x, got y)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.1.1","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/MrMrRobat/parametrize","docs":null,"changelog":null,"pypi":"https://pypi.org/project/parametrize/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}