{ "info": { "author": "Matthias Geier", "author_email": "Matthias.Geier@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Testing" ], "description": "`pytest` plugin: avoid repeating arguments in `parametrize`\n===========================================================\n\nThis is an alternative to the rejected pull request\n`#780 `__ of\n`pytest `__.\n\nInstallation\n------------\n\nJust get it from `PyPI `__::\n\n python3 -m pip install pytest-auto-parametrize --user\n\nUsage\n-----\n\nThis is an example for the usage of a `parametrized test`__ without using this\nplugin:\n\n__ http://docs.pytest.org/en/latest/parametrize.html\n\n.. code:: python\n\n import pytest\n\n testparams = [\n (1, 2, 3, 4, 5, 6, 7),\n (7, 6, 5, 4, 3, 2, 1),\n ]\n\n @pytest.mark.parametrize('a, b, c, d, e, f, g', testparams)\n def test_many_args(a, b, c, d, e, f, g):\n assert d == 4\n\nThe argument list has to be repeated, which is annoying.\n\nBy using this plugin, the repetition can be avoided:\n\n.. code:: python\n\n import pytest\n\n testparams = [\n (1, 2, 3, 4, 5, 6, 7),\n (7, 6, 5, 4, 3, 2, 1),\n ]\n\n @pytest.auto_parametrize(testparams)\n def test_many_args(a, b, c, d, e, f, g):\n assert d == 4\n\nThe auto-deduced parameters must be in the beginning of the parameter list, but\nany other parameters can be used afterwards, e.g. fixtures:\n\n.. code:: python\n\n import pytest\n\n testparams = [\n (1, 2, 3, 4, 5, 6, 7),\n (7, 6, 5, 4, 3, 2, 1),\n ]\n\n @pytest.fixture\n def myfixture():\n return 4\n\n @pytest.auto_parametrize(testparams)\n def test_many_args_and_fixture(a, b, c, d, e, f, g, myfixture):\n assert d - myfixture == 0\n\nLimitations\n-----------\n\nUnlike ``@pytest.mark.parametrize(...)`` the decorator\n``@pytest.auto_parametrize(...)`` cannot be used multiple times for the same\ntest function. It can be used together with one or multiple instances of\n``@pytest.mark.parametrize(...)``, though, as long as the \"auto\" arguments are\nin the beginning of the argument list.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mgeier/pytest-auto-parametrize", "keywords": "parametrized,testing", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pytest-auto-parametrize", "package_url": "https://pypi.org/project/pytest-auto-parametrize/", "platform": "any", "project_url": "https://pypi.org/project/pytest-auto-parametrize/", "project_urls": { "Homepage": "https://github.com/mgeier/pytest-auto-parametrize" }, "release_url": "https://pypi.org/project/pytest-auto-parametrize/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "pytest plugin: avoid repeating arguments in parametrize", "version": "0.1.0" }, "last_serial": 4803209, "releases": { "0.0.0": [], "0.1.0": [ { "comment_text": "", "digests": { "md5": "f22a4b7a4a076585460141bd9649ce89", "sha256": "8abe810a55af4fe920f55b1a1986e34ba3095d4d0a02424b9f906405b8a604b3" }, "downloads": -1, "filename": "pytest_auto_parametrize-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f22a4b7a4a076585460141bd9649ce89", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4920, "upload_time": "2016-10-02T18:58:46", "url": "https://files.pythonhosted.org/packages/1f/9f/0e315c050f1d939252efa9237e746ac657614ab77e4186a639fd4ca708cf/pytest_auto_parametrize-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34785f0f1eb44aff593e73a879f527c5", "sha256": "5187d9f720c58d749538977734c0b5ac2436fbcd6bf875c7e7162550e44bce56" }, "downloads": -1, "filename": "pytest-auto-parametrize-0.1.0.tar.gz", "has_sig": false, "md5_digest": "34785f0f1eb44aff593e73a879f527c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2718, "upload_time": "2016-10-02T18:58:50", "url": "https://files.pythonhosted.org/packages/98/c7/ef8743a3b3489a59b811e33c3977e01ec550311198f6c88dd21f36de853a/pytest-auto-parametrize-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f22a4b7a4a076585460141bd9649ce89", "sha256": "8abe810a55af4fe920f55b1a1986e34ba3095d4d0a02424b9f906405b8a604b3" }, "downloads": -1, "filename": "pytest_auto_parametrize-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f22a4b7a4a076585460141bd9649ce89", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4920, "upload_time": "2016-10-02T18:58:46", "url": "https://files.pythonhosted.org/packages/1f/9f/0e315c050f1d939252efa9237e746ac657614ab77e4186a639fd4ca708cf/pytest_auto_parametrize-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "34785f0f1eb44aff593e73a879f527c5", "sha256": "5187d9f720c58d749538977734c0b5ac2436fbcd6bf875c7e7162550e44bce56" }, "downloads": -1, "filename": "pytest-auto-parametrize-0.1.0.tar.gz", "has_sig": false, "md5_digest": "34785f0f1eb44aff593e73a879f527c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2718, "upload_time": "2016-10-02T18:58:50", "url": "https://files.pythonhosted.org/packages/98/c7/ef8743a3b3489a59b811e33c3977e01ec550311198f6c88dd21f36de853a/pytest-auto-parametrize-0.1.0.tar.gz" } ] }