{ "info": { "author": "Bruno Oliveira", "author_email": "nicoddemus@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Pytest", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Testing" ], "description": "===============\npytest-subtests\n===============\n\nunittest ``subTest()`` support and ``subtests`` fixture.\n\n.. image:: https://img.shields.io/pypi/v/pytest-subtests.svg\n :target: https://pypi.org/project/pytest-subtests\n :alt: PyPI version\n\n.. image:: https://img.shields.io/conda/vn/conda-forge/pytest-subtests.svg\n :target: https://anaconda.org/conda-forge/pytest-subtests\n\n.. image:: https://img.shields.io/pypi/pyversions/pytest-subtests.svg\n :target: https://pypi.org/project/pytest-subtests\n :alt: Python versions\n\n.. image:: https://travis-ci.com/pytest-dev/pytest-subtests.svg?branch=master\n :target: https://travis-ci.com/pytest-dev/pytest-subtests\n :alt: See Build Status on Travis CI\n\n.. image:: https://pytest-dev.visualstudio.com/pytest-subtests/_apis/build/status/pytest-dev.pytest-subtests?branchName=master\n :target: https://dev.azure.com/pytest-dev/pytest-subtests\n :alt: See Build Status on Azure\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n :target: https://github.com/ambv/black\n\n----\n\nThis `pytest`_ plugin was generated with `Cookiecutter`_ along with `@hackebrot`_'s `cookiecutter-pytest-plugin`_ template.\n\n\nFeatures\n--------\n\n* Adds support for `TestCase.subTest `__.\n\n* New ``subtests`` fixture, providing similar functionality for pure pytest tests.\n\n\nRequirements\n------------\n\n* ``Python`` >= 3.4.\n* ``pytest`` >= 4.4.\n\nInstallation\n------------\n\nYou can install ``pytest-subtests`` via `pip`_ from `PyPI`_::\n\n $ pip install pytest-subtests\n\n\n\nUsage\n-----\n\nunittest subTest() example\n^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n import unittest\n\n\n class T(unittest.TestCase):\n def test_foo(self):\n for i in range(5):\n with self.subTest(\"custom message\", i=i):\n self.assertEqual(i % 2, 0)\n\n\n if __name__ == \"__main__\":\n unittest.main()\n\n\n**Output**\n\n.. code-block::\n\n \u03bb pytest .tmp\\test-unit-subtest.py\n ======================== test session starts ========================\n ...\n collected 1 item\n\n .tmp\\test-unit-subtest.py FF. [100%]\n\n ============================= FAILURES ==============================\n _________________ T.test_foo [custom message] (i=1) _________________\n\n self = \n\n def test_foo(self):\n for i in range(5):\n with self.subTest('custom message', i=i):\n > self.assertEqual(i % 2, 0)\n E AssertionError: 1 != 0\n\n .tmp\\test-unit-subtest.py:9: AssertionError\n _________________ T.test_foo [custom message] (i=3) _________________\n\n self = \n\n def test_foo(self):\n for i in range(5):\n with self.subTest('custom message', i=i):\n > self.assertEqual(i % 2, 0)\n E AssertionError: 1 != 0\n\n .tmp\\test-unit-subtest.py:9: AssertionError\n ================ 2 failed, 1 passed in 0.07 seconds =================\n\n\n``subtests`` fixture example\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n.. code-block:: python\n\n def test(subtests):\n for i in range(5):\n with subtests.test(msg=\"custom message\", i=i):\n assert i % 2 == 0\n\n\n**Output**\n\n.. code-block::\n\n \u03bb pytest .tmp\\test-subtest.py\n ======================== test session starts ========================\n ...\n collected 1 item\n\n .tmp\\test-subtest.py .F.F.. [100%]\n\n ============================= FAILURES ==============================\n ____________________ test [custom message] (i=1) ____________________\n\n def test(subtests):\n for i in range(5):\n with subtests.test(msg='custom message', i=i):\n > assert i % 2 == 0\n E assert (1 % 2) == 0\n\n .tmp\\test-subtest.py:4: AssertionError\n ____________________ test [custom message] (i=3) ____________________\n\n def test(subtests):\n for i in range(5):\n with subtests.test(msg='custom message', i=i):\n > assert i % 2 == 0\n E assert (3 % 2) == 0\n\n .tmp\\test-subtest.py:4: AssertionError\n ================ 2 failed, 1 passed in 0.07 seconds =================\n\nContributing\n------------\nContributions are very welcome. Tests can be run with `tox`_:\n\n.. code-block::\n\n tox -e py37,linting\n\nLicense\n-------\n\nDistributed under the terms of the `MIT`_ license, \"pytest-subtests\" is free and open source software\n\n\nIssues\n------\n\nIf you encounter any problems, please `file an issue`_ along with a detailed description.\n\n.. _`Cookiecutter`: https://github.com/audreyr/cookiecutter\n.. _`@hackebrot`: https://github.com/hackebrot\n.. _`MIT`: http://opensource.org/licenses/MIT\n.. _`BSD-3`: http://opensource.org/licenses/BSD-3-Clause\n.. _`GNU GPL v3.0`: http://www.gnu.org/licenses/gpl-3.0.txt\n.. _`Apache Software License 2.0`: http://www.apache.org/licenses/LICENSE-2.0\n.. _`cookiecutter-pytest-plugin`: https://github.com/pytest-dev/cookiecutter-pytest-plugin\n.. _`file an issue`: https://github.com/nicoddemus/pytest-subtests/issues\n.. _`pytest`: https://github.com/pytest-dev/pytest\n.. _`tox`: https://tox.readthedocs.io/en/latest/\n.. _`pip`: https://pypi.org/project/pip/\n.. _`PyPI`: https://pypi.org/project\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pytest-dev/pytest-subtests", "keywords": "", "license": "MIT", "maintainer": "Bruno Oliveira", "maintainer_email": "nicoddemus@gmail.com", "name": "pytest-subtests", "package_url": "https://pypi.org/project/pytest-subtests/", "platform": "", "project_url": "https://pypi.org/project/pytest-subtests/", "project_urls": { "Homepage": "https://github.com/pytest-dev/pytest-subtests" }, "release_url": "https://pypi.org/project/pytest-subtests/0.2.1/", "requires_dist": [ "pytest (>=4.4.0)" ], "requires_python": ">=3.4", "summary": "unittest subTest() support and subtests fixture", "version": "0.2.1" }, "last_serial": 5101160, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "20f26037cc21164a2fe9ad353e9ceacc", "sha256": "75220550e04b26343a617082fea1e50069682b23534cff47e7511292f82f0e2e" }, "downloads": -1, "filename": "pytest_subtests-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "20f26037cc21164a2fe9ad353e9ceacc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 4886, "upload_time": "2019-04-02T00:52:44", "url": "https://files.pythonhosted.org/packages/6f/69/842b96540d53cd5993a60687c41d3f7e2bb05de6fd46769a44730eabfb53/pytest_subtests-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "802405c24bbffdfed2c4236f46fdc2cf", "sha256": "75b6e0e2a71aa641e47c171a09591290b9ad5de47d722687a68d7e887a65b133" }, "downloads": -1, "filename": "pytest-subtests-0.1.0.tar.gz", "has_sig": false, "md5_digest": "802405c24bbffdfed2c4236f46fdc2cf", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9056, "upload_time": "2019-04-02T00:52:46", "url": "https://files.pythonhosted.org/packages/54/1e/170fa1453f37d75a8b9cefd1c6076f7b445da9d0efad63b25b072433cde0/pytest-subtests-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "26c91df7cd2352d3d4e3bffd613dd286", "sha256": "e760f3aa9b467a33ca5c55ece0f94ad2521e62898a88ad2e5b64a6a2286014cf" }, "downloads": -1, "filename": "pytest_subtests-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "26c91df7cd2352d3d4e3bffd613dd286", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 5053, "upload_time": "2019-04-03T23:25:27", "url": "https://files.pythonhosted.org/packages/e2/72/3fe18be1bd0824f4fdeb70598ca42c428759630de59f08fefe9d21745f39/pytest_subtests-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7ade8c0a1cd89fbb7e1da90ccf80a051", "sha256": "0e48038a83c23c7cf60cde5b2f7d8bd61572c0292a9ca6da1c83ccfc88de38fa" }, "downloads": -1, "filename": "pytest-subtests-0.2.0.tar.gz", "has_sig": false, "md5_digest": "7ade8c0a1cd89fbb7e1da90ccf80a051", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9322, "upload_time": "2019-04-03T23:25:29", "url": "https://files.pythonhosted.org/packages/39/4e/3981610ed656928d5eb182187d7d0fe1f533491b7312d8a865dde1817c70/pytest-subtests-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "9e83de4a364c91bb24443b7401b20962", "sha256": "3842459a43e9a40c0ee388891b198847ea0a93649b88957efd8fc4c140ed458b" }, "downloads": -1, "filename": "pytest_subtests-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9e83de4a364c91bb24443b7401b20962", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 5266, "upload_time": "2019-04-04T22:08:31", "url": "https://files.pythonhosted.org/packages/62/81/863d99c007f6649b9e3a04f3eb48b5b0cdcd534903b591e742bd38ef9009/pytest_subtests-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b9b396fdc2b9e6a01f701b36e5e16ea", "sha256": "9c0480d4a44dbff5c6ad8ecb283ac66e5bc5ef951c6ba838d51e2548376b3a00" }, "downloads": -1, "filename": "pytest-subtests-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7b9b396fdc2b9e6a01f701b36e5e16ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9872, "upload_time": "2019-04-04T22:08:33", "url": "https://files.pythonhosted.org/packages/6c/da/d2dd79625b8bbc19dace569c24dcd29a37df2381259948a179ba1db6a778/pytest-subtests-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9e83de4a364c91bb24443b7401b20962", "sha256": "3842459a43e9a40c0ee388891b198847ea0a93649b88957efd8fc4c140ed458b" }, "downloads": -1, "filename": "pytest_subtests-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "9e83de4a364c91bb24443b7401b20962", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 5266, "upload_time": "2019-04-04T22:08:31", "url": "https://files.pythonhosted.org/packages/62/81/863d99c007f6649b9e3a04f3eb48b5b0cdcd534903b591e742bd38ef9009/pytest_subtests-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b9b396fdc2b9e6a01f701b36e5e16ea", "sha256": "9c0480d4a44dbff5c6ad8ecb283ac66e5bc5ef951c6ba838d51e2548376b3a00" }, "downloads": -1, "filename": "pytest-subtests-0.2.1.tar.gz", "has_sig": false, "md5_digest": "7b9b396fdc2b9e6a01f701b36e5e16ea", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 9872, "upload_time": "2019-04-04T22:08:33", "url": "https://files.pythonhosted.org/packages/6c/da/d2dd79625b8bbc19dace569c24dcd29a37df2381259948a179ba1db6a778/pytest-subtests-0.2.1.tar.gz" } ] }