{ "info": { "author": "Aric Coady", "author_email": "aric.coady@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Testing" ], "description": "[![image](https://img.shields.io/pypi/v/pytest-parametrized.svg)](https://pypi.org/project/pytest-parametrized/)\n[![image](https://img.shields.io/pypi/pyversions/pytest-parametrized.svg)](https://python3statement.org)\n[![image](https://pepy.tech/badge/pytest-parametrized)](https://pepy.tech/project/pytest-parametrized)\n![image](https://img.shields.io/pypi/status/pytest-parametrized.svg)\n[![image](https://img.shields.io/travis/coady/pytest-parametrized.svg)](https://travis-ci.org/coady/pytest-parametrized)\n[![image](https://img.shields.io/codecov/c/github/coady/pytest-parametrized.svg)](https://codecov.io/github/coady/pytest-parametrized)\n[![image](https://requires.io/github/coady/pytest-parametrized/requirements.svg)](https://requires.io/github/coady/pytest-parametrized/requirements/)\n[![image](https://api.codeclimate.com/v1/badges/2abbe9cb6925b77018d6/maintainability)](https://codeclimate.com/github/coady/pytest-parametrized/maintainability)\n[![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://pypi.org/project/black/)\n\n[Pytest plugin](https://docs.pytest.org/en/latest/plugins.html) for parametrizing tests with default iterables,\nproviding alternative syntax for [pytest.mark.parametrize](https://docs.pytest.org/en/latest/parametrize.html).\n\n# Usage\nDecorate tests with iterable default values.\n\n## functions\n```python\nfrom parametrized import parametrized\n\n@parametrized\ndef test(name=values, ...):\n \"\"\"test single parametrized arg with each value\"\"\"\n\n@parametrized.zip\ndef test(name=values, name1=values1, ...):\n \"\"\"test parametrized args with zipped values\"\"\"\n\n@parametrized.product\ndef test(name=values, name1=values1, ...):\n \"\"\"test parametrized args with cartesian product of values\"\"\"\n```\n\nZip before and after example:\n```python\n@pytest.mark.parametrize(\"test_input,expected\", [\n (\"3+5\", 8),\n (\"2+4\", 6),\n (\"6*9\", 42),\n])\ndef test_eval(test_input, expected):\n assert eval(test_input) == expected\n\n@parametrized.zip\ndef test_eval(test_input=(\"3+5\", \"2+4\", \"6*9\"), expected=(8, 6, 42)):\n assert eval(test_input) == expected\n```\n\nProduct before and after example:\n```python\n@pytest.mark.parametrize(\"x\", [0, 1])\n@pytest.mark.parametrize(\"y\", [2, 3])\ndef test_foo(x, y):\n pass\n\n@parametrized.product\ndef test_foo(x=(0, 1), y=(2, 3)):\n pass\n```\n\n## fixtures\n[Parametrized fixtures](https://docs.pytest.org/en/latest/fixture.html#fixture-parametrize) which simply return their param.\n\n```python\nfixture_name = parametrized.fixture(*params, **kwargs)\n```\n\nBefore and after example:\n```python\n@pytest.fixture(params=[0, 1], ids=[\"spam\", \"ham\"])\ndef a(request):\n return request.param\n\na = parametrized.fixture(0, 1, ids=[\"spam\", \"ham\"])\n```\n\n# Installation\n\n $ pip install pytest-parametrized\n\nNote `parametrized` can be added to pytest's namespace by registering it as a plugin in [conftest.py](https://docs.pytest.org/en/latest/plugins.html#requiring-loading-plugins-in-a-test-module-or-conftest-file).\n\n```python\npytest_plugins = 'parametrized', ...\n```\n\nHowever, pytest encourages [importing modules explicitly](https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace).\n\n# Tests\n100% branch coverage.\n\n $ pytest [--cov]\n\n# Changes\n1.1\n* pytest 4 compatibility\n\n1.0\n* `parametrized` keyword options\n\n0.2\n* `fixture` keyword options\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/coady/pytest-parametrized", "keywords": "pytest parametrize fixture", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "pytest-parametrized", "package_url": "https://pypi.org/project/pytest-parametrized/", "platform": "", "project_url": "https://pypi.org/project/pytest-parametrized/", "project_urls": { "Homepage": "https://github.com/coady/pytest-parametrized" }, "release_url": "https://pypi.org/project/pytest-parametrized/1.1/", "requires_dist": [ "pytest" ], "requires_python": ">=2.7", "summary": "Pytest plugin for parametrizing tests with default iterables.", "version": "1.1" }, "last_serial": 4675282, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "bd12255827764a6a6197c6f08dd0c3a3", "sha256": "0528f8abb49f84d08d535c9c343871e1b705f031319aa9a24925c8db1ace0f9e" }, "downloads": -1, "filename": "pytest_parametrized-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "bd12255827764a6a6197c6f08dd0c3a3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4055, "upload_time": "2017-10-20T03:17:36", "url": "https://files.pythonhosted.org/packages/d0/75/82d414047beaec0e3965ebaee0c05353dee0367872b74b55504318f09152/pytest_parametrized-0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7fa25466ba8a937861363885f09908da", "sha256": "afcdecdaa07fcf433453567948e31bb7b095e8ff012c9806e9bf777615e02ad5" }, "downloads": -1, "filename": "pytest-parametrized-0.1.tar.gz", "has_sig": false, "md5_digest": "7fa25466ba8a937861363885f09908da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2727, "upload_time": "2017-10-20T03:17:38", "url": "https://files.pythonhosted.org/packages/fd/6f/67a6ea33f58036e607e1862b0eb250e5cc8ab5d2c06b4beb0580760488a3/pytest-parametrized-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "e5ab000380e0101c46cc953bbd6b2049", "sha256": "a5377e79f252e220b7d78e00ceb6f021240205645f4b86b22b6748b7d7c09922" }, "downloads": -1, "filename": "pytest_parametrized-0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e5ab000380e0101c46cc953bbd6b2049", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 4370, "upload_time": "2017-12-13T03:12:15", "url": "https://files.pythonhosted.org/packages/70/01/ad10f1cdc6a3fb31398b3d4212876594f2e5f6b34f883c96acc933436e77/pytest_parametrized-0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "611a00e2a4171108be310b354a3d6499", "sha256": "53fd1b44184f62f54ae3e79ec242b943dc8d5e849534ac61b5a0c869f8a1abc2" }, "downloads": -1, "filename": "pytest-parametrized-0.2.tar.gz", "has_sig": false, "md5_digest": "611a00e2a4171108be310b354a3d6499", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 3210, "upload_time": "2017-12-13T03:12:16", "url": "https://files.pythonhosted.org/packages/68/49/60b491bef1bfddc58cfb6c78dd1dde406d33d365476ce950d082e335ee93/pytest-parametrized-0.2.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "b0855295e134af2ef532e16eecb1584d", "sha256": "92b3ff00fd322d34829d8b27724b678f3457bb35580e8a8d3a5997293b63d6dc" }, "downloads": -1, "filename": "pytest_parametrized-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b0855295e134af2ef532e16eecb1584d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 3703, "upload_time": "2018-12-08T22:18:10", "url": "https://files.pythonhosted.org/packages/04/aa/3039bfea8336de231d9e986b376ebff003ef2b020222b4e9f001fb0cf99a/pytest_parametrized-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "14ff8b8b954a2afbf1d7281f1158a90a", "sha256": "a5b399112bb6bd27b038887a80c8502b70e638deb8036f342e231ed4754e42ac" }, "downloads": -1, "filename": "pytest-parametrized-1.0.tar.gz", "has_sig": false, "md5_digest": "14ff8b8b954a2afbf1d7281f1158a90a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 3708, "upload_time": "2018-12-08T22:18:12", "url": "https://files.pythonhosted.org/packages/71/3f/bf9f880c0aad3ae7db76574150e96f1d066a2fc3264ec7d7782999d0a240/pytest-parametrized-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "b38434dd8aae0fb30310a7c6d7586a08", "sha256": "25b917c5b347d5ee4458ac197b42c1120dd432c6fe50c459b18d0735355327a1" }, "downloads": -1, "filename": "pytest_parametrized-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b38434dd8aae0fb30310a7c6d7586a08", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 3896, "upload_time": "2019-01-09T03:57:55", "url": "https://files.pythonhosted.org/packages/61/d2/5506ba4645f8dde4f58f298eaadfdce25f7f0bcd130c9186afe2729ab776/pytest_parametrized-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5152ffcde0ad9f815083fb0fc16f74dd", "sha256": "c778a5f20f224a292cd1ba9e14a12be7a4704afbe69eca7bdcf60fbb064e7c18" }, "downloads": -1, "filename": "pytest-parametrized-1.1.tar.gz", "has_sig": false, "md5_digest": "5152ffcde0ad9f815083fb0fc16f74dd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 3905, "upload_time": "2019-01-09T03:57:57", "url": "https://files.pythonhosted.org/packages/cd/81/6305861227ded1d129d86cfc8414fb1a91cda97a37ebe7d4fa6118089394/pytest-parametrized-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b38434dd8aae0fb30310a7c6d7586a08", "sha256": "25b917c5b347d5ee4458ac197b42c1120dd432c6fe50c459b18d0735355327a1" }, "downloads": -1, "filename": "pytest_parametrized-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "b38434dd8aae0fb30310a7c6d7586a08", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=2.7", "size": 3896, "upload_time": "2019-01-09T03:57:55", "url": "https://files.pythonhosted.org/packages/61/d2/5506ba4645f8dde4f58f298eaadfdce25f7f0bcd130c9186afe2729ab776/pytest_parametrized-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5152ffcde0ad9f815083fb0fc16f74dd", "sha256": "c778a5f20f224a292cd1ba9e14a12be7a4704afbe69eca7bdcf60fbb064e7c18" }, "downloads": -1, "filename": "pytest-parametrized-1.1.tar.gz", "has_sig": false, "md5_digest": "5152ffcde0ad9f815083fb0fc16f74dd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7", "size": 3905, "upload_time": "2019-01-09T03:57:57", "url": "https://files.pythonhosted.org/packages/cd/81/6305861227ded1d129d86cfc8414fb1a91cda97a37ebe7d4fa6118089394/pytest-parametrized-1.1.tar.gz" } ] }